boost::openmethod::make_boost_intrusive_virtual
Create a new object and return a boost_intrusive_virtual_ptr to it.
Synopsis
Declared in <boost/openmethod/interop/boost_intrusive_ptr.hpp>
template<
class Class,
class Registry = boost::openmethod::default_registry,
typename... T>
auto
make_boost_intrusive_virtual(T&&... args);
Description
Create an object using std::make_shared, and return a boost_intrusive_virtual_ptr pointing to it. Since the exact class of the object is known, the virtual_ptr is created using final_virtual_ptr.
Class is not required to be a polymorphic class.
Example
boost_intrusive_virtual_ptr<Animal> animal =
make_boost_intrusive_virtual<Dog>();
std::cout << poke(animal) << "\n"; // bark
Return Value
A boost_intrusive_virtual_ptr<Class, Registry> pointing to a newly created object of type Class.
Template Parameters
Name |
Description |
Class |
The class of the object to create. |
Registry |
A |
T |
Types of the arguments to pass to the constructor of |
See Also
Created with MrDocs