I have an std::vector of shared_ptr<Base> which contains many shared_ptr<Derived> objects. As a property of Base, each object has a string name for various reasons. I have a function std::shared_ptr<Base> GetObjectByName(const char* name) where I want to be able to return a derived component by evaluating if its name is the object Im looking for. What is the best way to get the std::shared_ptr<Derived> from the std::vector<std::shared_ptr<Base>>
Aucun commentaire:
Enregistrer un commentaire