How are smart pointers used when the precise type of objects needed are unknown
How would a shared_ptr or a unique_ptr resolve this? What about the class weak_ptr which is a weak reference to a shared_ptr?
How are smart pointers used when the precise type of objects needed are unknown
How would a shared_ptr or a unique_ptr resolve this? What about the class weak_ptr which is a weak reference to a shared_ptr?
As in when you have a polymorphic base class, but the exact derived class types will only be known at runtime? The solution is to use a smart pointer of the base class type then.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)