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

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

Cast to another type.

## Synopsis

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

    template<typename Derived>
    static
    Derived
    cast(Class& obj);

## Description

Cast an object to another type. If possible, use `static_cast`. Otherwise, use `Registry::rtti::dynamic_cast_ref`.

## Return Value

A reference to the same object, cast to `Derived`.

## Template Parameters

Name | Description
--- | ---
Derived | A lvalue reference type.

## Parameters

Name | Description
--- | ---
obj | A reference to a `Class` object.

Created with MrDocs