boost::openmethod::virtual_any::virtual_any

Construct from an any (copy).

Synopsis

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

virtual_any(Any const& other);

Description

Copies other, and acquires the v‐table pointer for the contained value, using virtual_traits<const Any&, Registry>::vptr.

Example

std::any spot_any = Dog{"Spot"};

// the v-table pointer is looked up from the type of the value the
// `any` contains
virtual_std_any spot = spot_any;

std::cout << name(spot) << "\n"; // Spot the dog

Parameters

Name

Description

other

An any.

Created with MrDocs