ANSI defined template design wont compile --->
From MCVC7.0 compiler error description:
invalid template argument 'number', constant expression expected
The template argument does not match the template declaration; a constant expression should appear within the angle brackets. Variables are not allowed as template actual arguments. Check the template definition to find the correct types.
The following sample generates C2975:
// C2975.cpp
template <char *P>
class x
{
char * f()
{
return P;
}
};
x<"abc"> *p = 0; // C2975 addr of object with internal linkage
Just what in all **** dont it like ? there is a simple const char design-time constant "abc" passed as a parameter to template.
I tried to compile this and it wont of course.... How to overcome this stupid glitch ? Isnt it a standard C++ ?!?!