I'm having a little trouble ...
Basically what I'd like to do is that a class template should return one of its parameters as a string like this:
#define ToStr(val) #val
template <class T>
cTest
{
T* mT;
//..some stuff using mT
char* GetName()
{
return ToStr(T);
}
};
This compiles but GetName() returns "T", not the actual parameter.
I tried to pass the parameter name as another template parameter:
template <class T,char* NAME=ToStr(T)> ...
This doesn't compile because:
"invalid expression as a template argument for NAME".
It won't compile for anything I tried but a NULL ptr.
SO what's the way to do this??
Thx,
ALex












