boost::openmethod::virtual_traits<boost::type_erasure::any<C, T const&>, Registry>::cast

Cast to a type.

Synopsis

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

template<typename U>
requires !std::is_rvalue_reference_v<U> && !detail::te_mutable_target<U>
static
decltype(auto)
cast(boost::type_erasure::any<C, T const&> arg);

Description

Extracts the referent using boost::type_erasure::any_cast, and registers U, stripped of reference and cv‐qualifiers, in Registry as a class derived from the owning any. Since the referent is const, U must be a value or a const reference; the other overloads are removed from the overload set.

Return Value

The value bound to arg, cast to U.

Template Parameters

Name

Description

U

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

Parameters

Name

Description

arg

The any reference method argument.

Created with MrDocs