R
reinisr
Hi!
This program:
template<class T_index, class T_data>
class AAA
{
public:
AAA(int ii = 0,int jj = 0) {}
};
AAA<int, int> a1(10, 20); // this works
AAA<int, int> a3(10, 20); // this works
class BBB
{
AAA<int, int> a4; // this works
AAA<int, int> a5(10, 20); // this doesn't work
};
int main()
{
return 0;
}
fails to compile, I tried
g++296 and g++32 give errors:
test.cpp:17: invalid data member initiailization
test.cpp:17: use `=' to initialize static data members
g++34 g++4 give errors:
test.cpp:17: error: expected identifier before numeric constant
test.cpp:17: error: expected `,' or `...' before numeric constant
test.cpp:17: error: ISO C++ forbids declaration of `parameter' with no
type
I tried to play with typename keyword with no success.
I wonder what Bjarne Stroustrup is going to say about this mess.
Any ideas?
Reinis
This program:
template<class T_index, class T_data>
class AAA
{
public:
AAA(int ii = 0,int jj = 0) {}
};
AAA<int, int> a1(10, 20); // this works
AAA<int, int> a3(10, 20); // this works
class BBB
{
AAA<int, int> a4; // this works
AAA<int, int> a5(10, 20); // this doesn't work
};
int main()
{
return 0;
}
fails to compile, I tried
g++296 and g++32 give errors:
test.cpp:17: invalid data member initiailization
test.cpp:17: use `=' to initialize static data members
g++34 g++4 give errors:
test.cpp:17: error: expected identifier before numeric constant
test.cpp:17: error: expected `,' or `...' before numeric constant
test.cpp:17: error: ISO C++ forbids declaration of `parameter' with no
type
I tried to play with typename keyword with no success.
I wonder what Bjarne Stroustrup is going to say about this mess.
Any ideas?
Reinis