boost::openmethod::virtual_traits<std::unique_ptr<Class>, Registry>::cast

Cast to a type.

Synopsis

template<typename Derived>
static
auto
cast(std::unique_ptr<Class>&& ptr);

Description

Cast a reference to the managed object, using static_cast if possible, and Registry::rtti::dynamic_cast_ref otherwise. If the cast succeeds, transfer ownership to a std::unique_ptr to the target type, and return it.

Return Value

A std::unique_ptr<Derived::element_type>.

Template Parameters

Name Description

Derived

A xvalue reference to a std::unique_ptr.

Parameters

Name Description

obj

A xvalue reference to a std::unique_ptr.

Created with MrDocs