This is the mail archive of the gcc-bugs@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]

Cannot inherit a typedef (in templates)


A very short example without any preprocessor inference.

I think this should compile. (Microsoft C and Borland C compile it.)
If I could bundle type declarations as typedefs in a base class,
this would make working with complicated templates much easier.


class base
{
protected:
  typedef int laber_t;
  typedef long rhabarber_t;
};

template<class B>
class derived : public B
{
  laber_t i;
  rhabarber_t j;
public:
  derived () : i (0), j (1) {}
};

main()
{
  derived<base> k;
}



-- 
Dirk Zoller				Fon: 06106-876566
Obere Marktstraße 5			e-mail: duz@sol-3.de
63110 Rodgau

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