boost::openmethod::final_virtual_ptr
Creates a virtual_ptr for an object of a known dynamic type.
Synopsis
Declared in <boost/openmethod/core.hpp>
template<
class Registry,
typename Arg>
auto
final_virtual_ptr(Arg&& obj);
Description
Creates a virtual_ptr to an object, setting its v‐table pointer according to the declared type of its argument. Assumes that the static and dynamic types are the same. Sets the v‐table pointer to the registry::static_vptr for the class.
Class is not required to be polymorphic.
If runtime checks are enabled, and the argument is polymorphic, checks if the static and dynamic types are the same. If not, calls the error handler with a final_error value, then terminates the program with abort.
Template Parameters
| Name | Description |
|---|---|
Registry |
A |
Arg |
The type of the argument. |
Parameters
| Name | Description |
|---|---|
obj |
A reference to an object. |
Created with MrDocs