Any++
Loading...
Searching...
No Matches
MODEL_MAP macros

Macros to define behavior of models for trait's. More...

Macros

#define __ANY_MODEL_MAP(trait_, t)
#define ANY_TEMPLATE_MODEL_MAP(model_, trait_, trait_types)
 ANY_TEMPLATE_MODEL_MAP macro.
#define TRAIT_TYPE(Name, T, Trait, ...)
 translates to the type defined in the model map of a trait. This is useful for associated types, e.g. Return types, which are defined via ANY_TYPE in the trait
#define ANY_MODEL_MAP(model_, trait_)
 ANY_MODEL_MAP macro.

Detailed Description

Macros to define behavior of models for trait's.

Macro Definition Documentation

◆ __ANY_MODEL_MAP

#define __ANY_MODEL_MAP ( trait_,
t )
Value:
template <> \
struct trait_##_model_map<_detail_ANYXX_TEMPLATE_ARGS(t)> \
: trait_##_default_model_map<_detail_ANYXX_TEMPLATE_ARGS(t)>

◆ ANY_MODEL_MAP

#define ANY_MODEL_MAP ( model_,
trait_ )
Value:
__ANY_MODEL_MAP(trait_, model_)

ANY_MODEL_MAP macro.

Parameters
class_name of the model, including namespace, in brackets
trait_name of the trait, including namespace

Must be placed in global namespace, and reachable for the instantiation of the associated v-table.

Examples
README.cpp, _1_any_shape.cpp, _2b_trait_monoid.cpp, _2c_trait_any_variant.cpp, _2o_trait_simple.cpp, and _5_any_template.cpp.

◆ ANY_TEMPLATE_MODEL_MAP

#define ANY_TEMPLATE_MODEL_MAP ( model_,
trait_,
trait_types )
Value:
__ANY_MODEL_MAP(trait_, __detail_ANYXX_ADD_HEAD( \
model_, _detail_REMOVE_PARENS(trait_types)))

ANY_TEMPLATE_MODEL_MAP macro.

Parameters
model_name of the model, including template parameters and namespace in brackets
trait_name of the trait, including namespace
trait_typestypes to be used as template parameters for the trait

Must be placed in global namespace, and reachable for the instantiation of the associated v-table.

Examples
_5_any_template.cpp.

◆ TRAIT_TYPE

#define TRAIT_TYPE ( Name,
T,
Trait,
... )
Value:
typename Trait::template Name<T, __VA_ARGS__>

translates to the type defined in the model map of a trait. This is useful for associated types, e.g. Return types, which are defined via ANY_TYPE in the trait

Parameters
Namename of the type definition in the trait
Tmodel type, including template parameters, in brackets
Traitname of the trait, including namespace
...additional template parameters for the type if it is a template itself