c++ - Default template argument causes error
- Radovan Zach (19/19) Dec 07 2008 Hello,
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








Radovan Zach <radovan.zach quick.cz>