I have a shared pointer storing a base class, like this:
std::shared_ptr<Base> baseClassPointer;
How do I check whether it is currently holding an instance of an SuperClassA
? Where:
public class SuperClassA : public Base {} // There can be many other superclasses
I've tried something like below, but obviously did not work:
std::is_same<SuperClassA, decltype(baseClassPointer->get())>::value;
Aucun commentaire:
Enregistrer un commentaire