This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with function template specialization
- From: Christian Convey <conveycj at npt dot nuwc dot navy dot mil>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 03 Jan 2005 07:42:29 -0500
- Subject: Re: Problem with function template specialization
- References: <71E911AFA5EEC0439ECFA770B8E9FD80039F9F31@rosxchcln5.enterprise.veritas.com>
Martin York wrote:
To make it compile do the following:
1) Add a new type(alias) that is a pointer to Foo.
typedef Foo* FooP;
2) Change your specialisation to use this new Type (and remove const
from the specialisation <>)
template <>
string toString<FooP>(const FooP& p) {
^^^^
NB. No const in here
Thanks. Can you explain the principal that applies here? I'm normally
accustomed to being able to use a type's definition (Foo*) interchangeably with
its name (FooP).
--
Christian Convey
Computer Scientist,
Naval Undersea Warfare Center
Newport, RI