Hi,

I looked for this information, but couldn't find it anywhere. Is there a difference between a "template class" and a "class template" or are they just two different ways of saying the same thing ?

Thanks a lot.

Re: Difference between a Template Class and a Class Template 80 80
Re: Difference between a Template Class and a Class Template 80 80

Thanks, but I sort of know what templates are and how to implement them.

I found this information on the ibm website.

http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=/com.ibm.xlcpp8l.doc/language/ref/class_templates.htm

which answers my question.

Re: Difference between a Template Class and a Class Template 80 80

Class Template is the code for generating template classs.

i.e.

template<typename T> foo { } // class template

foo<int> t; // template class

commented: Wasn't worth waiting two YEARS for :( -4
Re: Difference between a Template Class and a Class Template 80 80

Template class:
A generic definition or a parameterized class not instantiated until the client provides the needed information. It’s jargon for plain templates.

Class template:
A class template specifies how individual classes can be constructed much like the way a class specifies how individual objects can be constructed. It’s jargon for plain classes.

Re: Difference between a Template Class and a Class Template 80 80

class template is a template that defines a class

template <typename T> class SomeClass {...}; // this is a class template
template <typename T> int some_function(T&) {...} // this is a function template
A template class is a particular kind of class. There are many kinds of classes, and in particular, template classes are those defined using a class template. Contrast:

SomeClass sc; // SomeClass is an ordinary (non-template) class
SomeClass<int> sc; // SomeClass<int> is a template class

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.