Topic: STL with gcc-2.6.3 problem


Author: rongli@mcdgs01.cr.usgs.gov ()
Date: 1995/08/03
Raw View
 Hi, folks.

 I am using STL with gcc-2.6.3 is compiler, and having the problem with
the static member function definition.
 Here is the simplified code :

--------------------------------------------

#define A b

template <class T>
class foo {
public:
    typedef A<T> foo1;
protected:
    static A<T> foo2;
};

template <class T>
foo<T>::foo1 foo<T>::foo2;    // this is line #13

---------------------------------------------

 The compiler will give the error as:

./line 13:  parse error before `<'


 Why is parse error occurring ?  Should there be ways to work around
this if the compiler can't handle this ?

 Thanks.




--


----------------------------------------------------------------------
 Rong Li   |
 rongli@resdgw16.er.usgs.gov |
---------------------------------------------------------------------