   how 2 know what template <class TYPE> is?
  ie:if we have a template class:   template <class TYPE>class TObject{//...};  how do we know (either compile time either run time) what TYPE really is? is it an object or ptr to object? once we determine that, what are the usuall ways of finding out if TYPE is a certain class (sub or sup?)[edited by - original vesoljc on July 31, 2003 9:32:25 PM]
  the Type is anything you want it to be.. ie:template <typename T>class myclass{    T value;};myclass<int>   myint;myclass<float> myfloat;will create these classes internally by the compiler:class myclassi{ int value;};class myclassf{ float value;};So you don''t know the type until you specify it ;  missing the point...i know what type it is...but how do we make the template know what type it is?ie: we want our template class to act diffrently if type is a pointer, and again diffrently if type is not a pointer... ;  You create a template specialization:template <typename T>class S { ... };template <typename T*>class S { ... }; // specialized code for pointersnow if you call S<int> obj the regular version will be used to create the object but if you call S<int*> obj2 the specialized code for pointers will be used. If you're using MSVC, only 2003 will accept this and if you're using another version of it you're out of luck   [edited by - fallenang3l on July 31, 2003 9:44:39 PM];  http://www.uml-zone.com/getHelpOn/Article/10202/0/page/3RTTI is probably the answer you''re looking for. ;  No,  boost  is what he''s looking for. Spefically the type traits library. ;  fallenang3l,Your method isn''t quite correct, it''s like this:template <class T>class Foo {};template <class T>class Foo<T*> {};  // considered a partial specialisation, not supported by VC7 (is supported by 7.1)And, the code I posted in the other thread will determine what type it is.  If you really want to learn a lot about templates get the book Modern C++ Design by Andrei Alexandrescudesertfox ;  the above posters are correct, and I don''t normally post this kind of post (ie one that questions your need, instead of helping you solve your problem), but I honestly wonder if you are using templates in the most convienient way, if you need to differentiate between the argument types ... by definition, if an algorithm needs to know what type it operates on, it is using reflection, and NOT truely generic.  Now of course, the speciallization exists for a purpose, but I think the main purpose is simple to support explicit optimization for known types (such as bools, and pointers - which may be what your doing) ... but in general ... if you have an algorithm that works one way on pointers, and another on non-pointers, writing TWO seperate templates, and declaring their requirements, is much less confusing to everyone involved. ;  two templates it is so something like this should do it? template <class T>class TObject{};template <class T*>class TObjectPtr{};