c++ - Abstract base member variable in base class -
i want specify interface requires abstract class have type member variable. i'll try replicate situation here: class blob { int data[32]; }; class worker { string name; abstract void workon(blob&) = 0; } class abstract { vector<shared_ptr<w>> workerlist; blob allthestuff; abstract void somethingelse() = 0; void doallthework() { (w : workerlist) { w->workon(allthestuff); } } }; class b_blob : public blob { int moredata[4096]; }; class bulbasaurtrainingcamp : public abstract { b_blob allthestuff; void somethingelse() {} // implemented // class accept bulbasaurs workerlist }; class bulbasaur : worker { bulbasaur(): name("fushigidane") {} void workon(blob& b) { // bulbasaurs cover *all* workspace crap (int i=0; i<sizeof(b.data[0])/sizeof(b.data); ++i) { b.data[i] = *((int*)&("crap")); } (i=0; i<sizeof(b.moredata[0])/sizeof(b.moredata); ++i) { b.moredata...