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

Move‐cast to another type (since c++20)

Synopsis

template<class Derived>
static
decltype(auto)
cast(std::shared_ptr<Class>&& obj);

Description

Cast to a std::shared_ptr xvalue reference to another type. If possible, use std::static_pointer_cast. Otherwise, use std::dynamic_pointer_cast.

This overload is only available for C++20 and above, because rvalue references overloads of std::static_pointer_cast and std::dynamic_pointer_cast were not available before.

Return Value

A std::shared_ptr&& to the same object, cast to Derived::element_type.

Template Parameters

Name Description

Derived

A xvalue reference to a std::shared_ptr.

Parameters

Name Description

obj

A xvalue reference to a shared_ptr<Class>.

Created with MrDocs