I have the following code, it compiles with gcc 4.4 with no warnings, and returns 42.
template<typename T>
struct foo
{ };
template<typename T>
struct foo<void (T)>
{
enum { value = 42 };
};
int main()
{
return foo<void ((int))>::value;
}
Now, I see why it should work when the template parameter is void (int)
, but what's the deal with the double parentheses? Is this legal in C++? Is it the same as void (int)
?
Cheers