Templates and inheritance of types

Gerald Pfeifer pfeifer@dbai.tuwien.ac.at
Mon Aug 10 03:37:00 GMT 1998


[ Cc: Mark, 'cause I realized that you made a couple of changes in
  related code recently... ]
  

For the small snippet below,

---- snippet ----
#include <vector>

template <class T>
class C : public vector<T>
    {
    C( typename /*vector<T>::*/const_iterator b )
        { }
    };
---- snippet ----

egcs-main-CVS gives me 

  6: parse error before `)'
  7: missing ';' before right brace

unless I uncomment the  vector<T>::  in line 6. This does not happen
with egcs-1.1-CVS, which simply compiles the example.

Is it really necessary to explicitely write  vector<T>:: ?
I.e., which of egcs-1.1 and egcs-main is wrong?

Gerald
-- 
Gerald Pfeifer (Jerry)      Vienna University of Technology
pfeifer@dbai.tuwien.ac.at   http://www.dbai.tuwien.ac.at/~pfeifer/




More information about the Gcc-bugs mailing list