1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
## use_classes
### Synopsis
Defined in <boost/openmethod/core.hpp>.
```c++
namespace boost::openmethod {
template<class... Classes, class Policy = BOOST_OPENMETHOD_DEFAULT_REGISTRY>
struct use_classes {
use_classes();
~use_classes();
};
}
```
Usage:
```c++
use_classes<Classes...> some_unique_name; // at file scope
```
### Description
`use_classes`, instantiated as a static object, registers `Classes` in `Policy`.
Classes potentially involved in a method definition, an overrider, or a method
call must be registered via `use_classes`. A class may be registered multiple
times. A class and its direct bases must be listed together in one or more
instantiations of `use_classes`.
Virtual and multiple inheritance are supported, as long as they don't result in
a class lattice that contains repeated inheritance.
NOTE: The default value for `Policy` is the value of
`BOOST_OPENMETHOD_DEFAULT_REGISTRY` when `<boost/openmethod/core.hpp>` is
included. Subsequently changing it has no retroactive effect.
### Members
#### constructor
```c++
use_classes();
```
Registers `Classes` and their inheritance relationships in `Policy`.
#### destructor
```c++
~use_classes();
```
Removes `Classes` and their inheritance relationships from `Policy`.
|