The generic form of a template must be referenced using specialization parameters. For example, for a template class named foo, taking two template parameters, then a legal reference might have the form
foo<int, char>
Referring to the template as just foo is legal in only two circumstances:
template<class T> class foo { public: foo(); // legal use of bare template name foo& operator=(const foo&); }; foo<foo> x; // error: not a template template argument foo y; // error: needs specialization parameters
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|