I have vector of shared_ptrs to objects that are derived from Abstract class
std::vector<std::shared_ptr<Abstract>> objects;
the following fails:
Concrete* c = objects[0].get()
With:
error: invalid conversion from ‘Abstract*’ to ‘Concrete*
How can I get access to object of concrete type
Aucun commentaire:
Enregistrer un commentaire