boost::openmethod::virtual_traits

Traits for types that can be used as virtual arguments.

Synopsis

template<
    typename T,
    class Registry>
struct virtual_traits;

Description

virtual_traits must be specialized for each type that can be used as a virtual parameters. It enables methods to:

  • find the type of the object the argument refers to (e.g. `Cat` from `Cat&`)

  • obtain a non‐modifiable reference to that object (e.g. a `const Cat&` from `Cat&`)

  • cast the argument to another type (e.g. cast a `Animal&` to a `Cat&`)

Requirements

Specializations of virtual_traits must implement the members deswcribed to the VirtualTraits blueprint.

Template Parameters

Name Description

T

A type referring (in the broad sense) to an instance of a class.

Registry

A registry.

Created with MrDocs