This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem With templates


Hi, 
?
The following code does not compile. The code seems all right and it
compiles on MSVC, HP-UX aCC and Solaris CC (Forte) compiler. I don?t really
know why it does not on g++. I have tried gcc 3.4.5, 4.0.2 on linux.
?
Any work around is also ok.
?
#include <list>
?
?
template <class T>
class X
{
public:
??? struct B
??? {
??? };
??? void method()
??? {
??????? B b;
??????? std::list<B>::iterator c;
??? }
};
?
int main()
{
}??????????????????? 
?
The error is given below ?
?
test_std.cpp: In member function `void X<T>::method()':
test_std.cpp:14: error: expected `;' before "c"
?
?
Regards,
?
Dinabandhu Mitra


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]