boost::openmethod::inplace_vptr_derived :: Boost.OpenMethod

# boost::openmethod::inplace_vptr_derived

Adjust the v‐table pointer embedded in a class.

## Synopsis

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

    template<
        class Class,
        class Base,
        class... MoreBases>
    class inplace_vptr_derived;

## Description

`inplace_vptr_derived` is a [CRTP] mixin](https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern) that adjusts the v‐table pointer in a `inplace_vptr_base`. It can be used only with classes that have `inplace_vptr_base` as a direct or indirect base class.

`inplace_vptr_derived` registers the class and its bases in `Registry`. It is not necessary to register them with `use_class` or BOOST_OPENMETHOD_REGISTER

The v‐table pointer is obtained directly from the `Registry`'s `static_vptr` variable. No hashing is involved. If all the classes in `Registry` inherit from `inplace_vptr_derived`, the registry needs not have a `policies::vptr` policy, nor any policy it depends on (like `policies::type_hash`).

## Protected Member Functions

Name | Description
`inplace_vptr_derived` [constructor] | Set the vptr to `Class`'s v‐table.
`~inplace_vptr_derived` [destructor] | Set the vptr in each base class.

## Template Parameters

Name | Description
--- | ---
Class | The class in which to embed the v‐table pointer.
Base | A direct base class of `Class`.
MoreBases | More direct base classes of `Class`.

## See Also

`inplace_vptr_base` for an example.

Created with MrDocs