samedi 23 décembre 2017

Using a Pure Abstract Data Type a a return?

I would like to use a pure adt as a return argument, as in *summary):

class PADT {
public:
   virtual ADT func() = 0;
   virtual int iFun() = 0;
}

class X : PADT {
public:
   virtual PADT func() { return X(); }
   virtual int iFun()  { return 1; }
}

Class Y : PADT {
public:
   virtual PADT func() { return Y(); }
   virtual int iFun()  { return 2; }
}

And then, how could I iuse it?

Aucun commentaire:

Enregistrer un commentaire