boost::openmethod::default_registry

Default registry.

Description

default_registry is a predefined registry, and the default value of BOOST_OPENMETHOD_DEFAULT_REGISTRY. It contains the following policies:

If BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS is defined, default_registry also includes the runtime_checks policy.

Use BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS with caution, as inconsistent use of the macro can cause ODR violations. If defined, it must be in all the translation units in the program that use default_registry, including those pulled from libraries.

For a program and its shared libraries to contribute to the same default_registry, its state must be shared across the modules, with BOOST_OPENMETHOD_IMPORT_REGISTRY, BOOST_OPENMETHOD_EXPORT_REGISTRY and BOOST_OPENMETHOD_INSTANTIATE_REGISTRY

// header, every translation unit of a client module:
BOOST_OPENMETHOD_IMPORT_REGISTRY(boost::openmethod::default_registry);
// header, every translation unit of the owning module:
BOOST_OPENMETHOD_EXPORT_REGISTRY(boost::openmethod::default_registry);
// exactly one .cpp of the owning module:
BOOST_OPENMETHOD_INSTANTIATE_REGISTRY(boost::openmethod::default_registry);