Hello!
I've got this code to port from windows to linux.
template<class T, int Size>
class CVector {
/* ... */
};
template<int n, int m>
class CTestClass {
public:
enum { Size = 1 << n };
private:
static CVector<int, Size> a; // main.cpp:19
};
template<int n, int m>
CVector<int, CTestClass<n, m>::Size> CTestClass<n, m>::a; // main.cpp:24
It compiles with VS2008, but doesn't with g++ 4.3.2. The error I receive is:
main.cpp:24: error: conflicting declaration ‘CVector CTestClass::alpha_to’
main.cpp:19: error: ‘CTestClass< n, m >::alpha_to’ has a previous declaration as ‘CVector< int, CTestClass< n, m >::Size > CTestClass< n, m >::alpha_to’
main.cpp:24: error: declaration of ‘CVector< int, CTestClass< n, m >::Size > CTestClass< n, m >::alpha_to’ outside of class is not definition
Does someone know how to make it compilable via g++?
Thanks!