Re: Problem with function template specialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux