boost::openmethod::virtual_traits<boost::intrusive_ptr<Class>, Registry>

Specialize virtual_traits for boost::intrusive_ptr.

Synopsis

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

template<
    typename Class,
    class Registry>
struct virtual_traits<boost::intrusive_ptr<Class>, Registry>;

Example

struct Animal : boost::intrusive_ref_counter<Animal> {
    virtual ~Animal() = default;
};
struct Dog : Animal {};
struct Cat : Animal {};

BOOST_OPENMETHOD_CLASSES(Animal, Dog, Cat);

BOOST_OPENMETHOD(poke, (virtual_<boost::intrusive_ptr<Animal>>), std::string);

BOOST_OPENMETHOD_OVERRIDE(
    poke, (boost::intrusive_ptr<Dog> animal), std::string) {
    return "bark";
}

BOOST_OPENMETHOD_OVERRIDE(
    poke, (boost::intrusive_ptr<Cat> animal), std::string) {
    return "hiss";
}

Type Aliases

Name

Description

rebind

Rebind to a different element type.

virtual_type

Class, stripped from cv‐qualifiers.

Static Member Functions

Name

Description

peek

Return a reference to a non‐modifiable Class object.

cast

Cast method argument to overrider argument.

Template Parameters

Name

Description

Class

A class type, possibly cv‐qualified.

Registry

A registry.

See Also

Created with MrDocs