boost::openmethod::virtual_traits<std::any const&, Registry>::vptr

Returns a reference to a v‐table pointer for an object.

Synopsis

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

static
vptr_type const&
vptr(std::any const& arg);

Description

Acquires the type_id of the value stored in arg, using std::any::type(). This requires the registry's rtti policy to be std_rtti; the requirement is enforced with a static_assert. Registers std::any ‐ the root class of the contained types ‐ in Registry.

Passes it to the registry's policies::vptr policy, which must provide policies::VptrFn::vptr. Both policies::vptr_vector and policies::vptr_map do.

If the registry has a type_hash policy, uses it to convert the type id to an index; otherwise, uses the type_id as the index.

If the registry contains the runtime_checks policy, verifies that the index falls within the limits of the vector. If it does not, and if the registry contains a error_handler policy, calls its error function with a missing_class value, then terminates the program with abort.

Return Value

A reference to the v‐table pointer for the stored value.

Parameters

Name

Description

arg

A reference to a const any.

Created with MrDocs