samedi 30 juillet 2016

Override method from inner class that I'm extending

class A : public B {}

class B : public C {}

class C
{
 public :

     class D : public I<T1>
     {
         virtual void method() const;
     }; 

     class E : public I<T2>
     {
         virtual void method() const;
     }; 

     class F : public I<T2>
     {
         virtual void method() const;
     }; 
 public :
     D d;
};

I would like in class A to override 'method' in class D. Is it possible? I always get the message :

error: cannot define member function 'method' within 'A'

Aucun commentaire:

Enregistrer un commentaire