Cannot inherit a typedef (in templates)

Dirk Zoller duz@onlinehome.de
Sat Jun 3 08:56:00 GMT 2000


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


More information about the Gcc-bugs mailing list