December 07, 2008 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;
}
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply