Problem With templates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux