boost::openmethod::weak_virtual_ptr::weak_virtual_ptr

Construct from a std::weak_ptr to a derived class

Synopsis

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

template<class Other>
requires IsPolymorphic<Other, Registry> && std::is_constructible_v<
            std::weak_ptr<Class>, const std::weak_ptr<Other>&>
weak_virtual_ptr(std::weak_ptr<Other> const& other);

Description

Construct the std::weak_ptr from other. Lock other to find the dynamic type of the object, and set the v‐table pointer accordingly. If other has expired, the v‐table pointer is set to nullptr.

Requirements

  • Other must be a polymorphic class, according to the rtti policy of Registry.

  • std::weak_ptr<Class> must be constructible from const std::weak_ptr<Other>&.

Parameters

Name

Description

other

A std::weak_ptr to a polymorphic object.

Created with MrDocs