www.digitalmars.com         C & C++   DMDScript  

c++ - Default template argument causes error

Hello,
 the code snippet at the end yields

 Test.cpp(8) : Error: no type for argument 'T'

I don't understand why. The code seems alright. Could anybody please explain?

Thank you very much,
Radovan

Now the snippet:

template<typename T>
struct get_No
{
	static const int value = 10;
};

template<typename T, int No = get_No<T>::value>
struct BlahBlah
{};


int main( )
{
	BlahBlah<int> hu;
}
Dec 07 2008