boost::openmethod::virtual_ptr<SmartPtr, Registry>::operator=
Assign from nullptr
Synopsis
Declared in <boost/openmethod/core.hpp>
virtual_ptr&
operator=(std::nullptr_t);
Description
Reset the object pointer using its default constructor. Set the v‐table pointer to nullptr.
Example
// classes not required to be polymorphic
struct Animal {};
struct Cat : Animal {};
struct Dog : Animal {};
BOOST_OPENMETHOD_CLASSES(Animal, Cat, Dog);
virtual_ptr<std::shared_ptr<Dog>> p = make_shared_virtual<Dog>();
p = nullptr;
BOOST_TEST(p.get() == nullptr);
BOOST_TEST(p.vptr() == nullptr);
BOOST_TEST((p == virtual_ptr<std::shared_ptr<Dog>>()));
Parameters
Name |
Description |
value |
A |
Created with MrDocs