c++ - Conversions between object types -
what i'm trying do:
void startapp() { //create validator medvalidator* val = new medvalidator(); //create reporsitory medicinerepository* repo= new medrepo() ; //create controller control wh(repo, val); ...}
here view @ used types:
class medvalidator { public: void validate(const medicine& s) throw(medexception); }; class medicinerepository { public: virtual void addmed(medicine s) ; }; class medrepo : public medicinerepository{ public:void addmed(medicine s); protected: vector<medicine*> medlist; };
i multiple markers @ line - candidates are: - no matching function call 'control::control(medicinerepository&, medvalidator*&)'
@ startapp()
when i'm declaring wh
class control { public: control(medrepo* repo, medvalidator* validator);};
how can fix this?i hope amount of code enough,if it's needed more i'll add.
the constructor control
takes medrepo*
argument:
control(medrepo* repo, medvalidator* validator);};
but passing medicinerepository*
:
medicinerepository* repo= new medrepo() ; //create controller control wh(repo, val);
also, don't use exception specifications, they're bad.
Comments
Post a Comment