boost::openmethod::shared_virtual_ptr

Alias for a virtual_ptr<std::shared_ptr<T>>.

Synopsis

Declared in <boost/openmethod/interop/std_shared_ptr.hpp>

template<
    class Class,
    class Registry = boost::openmethod::default_registry>
using shared_virtual_ptr = virtual_ptr<std::shared_ptr<Class>, Registry>;

Example

shared_virtual_ptr<Animal> animal = make_shared_virtual<Dog>();
std::shared_ptr<Animal> owner = animal.pointer();

BOOST_TEST(owner.use_count() == 2);

See Also

Created with MrDocs