N
Noah Roberts
template < typename T1, typename T2, T2 T1::*x >
struct test1
{
};
struct test2
{
int x;
typedef test1<test2, int, &test2::x> type;
};
int main()
{
test2 t2;
test2::type t1;
}
Compiles with g++ and comeau online (warnings about unused variables)
but MS compiler gives error:
error C2327: 'test2::x' : is not a type name, static, or enumerator
e:\playground_projects\testing_ground\testing_ground\testing_ground.cpp 14
1 Error
error C2065: 'x' : undeclared identifier
e:\playground_projects\testing_ground\testing_ground\testing_ground.cpp 14
2 Error
I'm assuming MS is broken, since comeau accepts, but can anyone validate?
struct test1
{
};
struct test2
{
int x;
typedef test1<test2, int, &test2::x> type;
};
int main()
{
test2 t2;
test2::type t1;
}
Compiles with g++ and comeau online (warnings about unused variables)
but MS compiler gives error:
error C2327: 'test2::x' : is not a type name, static, or enumerator
e:\playground_projects\testing_ground\testing_ground\testing_ground.cpp 14
1 Error
error C2065: 'x' : undeclared identifier
e:\playground_projects\testing_ground\testing_ground\testing_ground.cpp 14
2 Error
I'm assuming MS is broken, since comeau accepts, but can anyone validate?