boost::openmethod::virtual_traits<virtual_any<Any, Registry>&&, Registry>::cast

Cast to a type.

Synopsis

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

template<typename U>
static
decltype(auto)
cast(virtual_any<Any, Registry>&& arg);

Description

If U is the virtual_any itself (by rvalue reference), returns arg unchanged. Otherwise, extracts the stored value using virtual_traits<Any&&, Registry>::cast, and registers U, stripped of reference and cv‐qualifiers, in Registry as a class derived from Any.

Return Value

The value stored in arg, cast to U.

Template Parameters

Name

Description

U

The target type (e.g. Dog&&, const Dog&, Dog).

Parameters

Name

Description

arg

An rvalue reference to the virtual_any method argument.

Created with MrDocs