In moving from gcc 3.4 to v4.0.0 my code stops working (what a
surprise).
Basically, I have a header file:
____________________
template<int I, int J>
class Inner
{
Inner(){};
};
class Outer
{
Outer(){};
typedef Inner<1,2> Foo;
};
---------------
and a source file:
___________________
#include "test.h"
int main(void)
{
};
template class Outer::Foo;
-------------------
which, when compiling, gives the errors
test.cpp:5: error: using typedef-name 'Outer::Foo' after 'class'
test.h:10: error: 'Outer::Foo' has a previous declaration here
VS.NET gives the error "C2242: typedef name cannot follow
class/struct/union"
I'm a bit stumped, and I don't know templates very well. The source
file code had originally read:
.....
template Outer::Foo;
which compiles under VS.NET, but gives the G++ error:
test.cpp:8: error: expected unqualified-id before ';' token
Unfortunately I am in the position that I need it to compile under both
OSs.