P
Patrick Kowalzick
Dear all,
the code below does not compile with g++ (3.3.1), but with MSVC (7.1). So I
am wondering what might be wrong with it. Any ideas?
Thanks,
Patrick
struct A
{
template <typename T> static void foo(T = T()) {}
};
template <typename T>
struct B
{
void foo()
{
T::foo( 0 ); // works
T::foo<int>( 0 ); // not compiling
T::foo<int>(); // not compiling
}
};
int main()
{
B<A> x;
x.foo();
}
the code below does not compile with g++ (3.3.1), but with MSVC (7.1). So I
am wondering what might be wrong with it. Any ideas?
Thanks,
Patrick
struct A
{
template <typename T> static void foo(T = T()) {}
};
template <typename T>
struct B
{
void foo()
{
T::foo( 0 ); // works
T::foo<int>( 0 ); // not compiling
T::foo<int>(); // not compiling
}
};
int main()
{
B<A> x;
x.foo();
}