This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Cannot inherit a typedef (in templates)
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Cannot inherit a typedef (in templates)
- From: Dirk Zoller <duz at onlinehome dot de>
- Date: Sat, 03 Jun 2000 17:56:10 +0200
- Organization: none
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