boost::openmethod::virtual_traits<virtual_ptr<Class, Registry>, Registry>::cast :: Boost.OpenMethod

# boost::openmethod::virtual_traits<virtual_ptr<Class, Registry>, Registry>::cast

Cast to another type.

## Synopses

Declared in `<boost/openmethod/core.hpp>`

Cast to another type.

    template<typename Derived>
    static
    decltype(auto)
    cast(virtual_ptr<Class, Registry> const& ptr);

» more...

Cast to another type.

    template<typename Derived>
    static
    decltype(auto)
    cast(virtual_ptr<Class, Registry>&& ptr);

» more...

## Return Value

- A lvalue reference to a `virtual_ptr` to the same object, cast to `Derived::element_type`.

- A xvalue reference to a `virtual_ptr` to the same object, cast to `Derived::element_type`.

## Parameters

Name | Description
--- | ---
obj | A lvalue reference to a `virtual_ptr`.

Created with MrDocs