This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with function template specialization



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]