|
Any++
|
Open dispatch method. Solves the expression problem. More...
#include <anyxx.hpp>
Public Types | |
| enum class | kind { single , multiple } |
| using | erased_function_t |
| using | dispatch_matrix_t = dispatch_matrix<erased_function_t, Args...>::type |
| using | default_ = typename dispatch_function_types<R, Args...>::default_type |
Public Member Functions | |
| template<typename... Classes> | |
| auto | define (auto f) |
| Register a dispatch target for the model provided in the type parameter. | |
| template<typename... ActualArgs> | |
| auto | operator() (ActualArgs &&... actual_args) const |
| Invoke the dispatch. | |
| auto & | get_dispatch_default_hook () |
Public Attributes | |
| dispatch_matrix_t | dispatch_matrix_ |
| default_::function_t | dispatch_default_hook_ |
| default_::function_t::connection | default_connection_ |
| dispatch_access< dispatch_kind, 0, Args... > | dispatch_access_ |
Static Public Attributes | |
| static constexpr std::size_t | dimension_count |
| static const constexpr kind | dispatch_kind |
Open dispatch method. Solves the expression problem.
| R | The return type. |
| Args | The parameter types. The signature of the dispatch is R(Args...). |
The open dispatch is managed via a singleton object of this class.
To declare and define a singleton, use the ANY_SINGLETON and ANY_SINGLETON_DECLARE macros.
Each trait of the any tagged as virtual must have open dispatch enabled. To enable open dispatch, declare a struct named 'trait_name'_has_open_dispatch.
Examples are listed here: dispatch
| using anyxx::dispatch< R(Args...)>::erased_function_t |
|
inline |
Register a dispatch target for the model provided in the type parameter.
| Classes | The models for which the dispatch target is registered. |
| f | The dispatch target. |
|
inline |
Invoke the dispatch.
| ActualArgs | The deduced argument types for the dispatch call. |
| actual_args | Arguments fulfilling the signature of this dispatch. |
The called function is determined by the any objects marked with virtual_ in the class instantiation.
| default_::function_t::connection anyxx::dispatch< R(Args...)>::default_connection_ |
|
staticconstexpr |
|
staticconstexpr |