MPLLIBS_LAZY_METAFUNCTION

Synopsis

#define MPLLIBS_LAZY_METAFUNCTION(name, args) \
  // unspecified

Description

This macro is similar to MPLLIBS_METAFUNCTION but it uses the evaluated arguments in its body.

The metafunctions defined using this macro support currying.

The macro defines a helper metafunction as well. The name of it is generated using the MPLLIBS_HELPER_METAFUNCION macro. When it is not defined, the following default is used:

#define MPLLIBS_HELPER_METAFUNCTION(name) BOOST_PP_CAT(name, __impl)
#include <mpllibs/metamonad/lazy_metafunction.hpp>

Expression semantics

For any body angly-bracket expression, n > 0 and arg1 ... argn template arguments the following

MPLLIBS_LAZY_METAFUNCTION(name, (arg1)(arg2)...(argn)) ((body));

is equivalent to

MPLLIBS_METAFUNCTION(name, (arg1)(arg2)...(argn)) ((body));

but when arg1, arg2, ..., argn is referred to in body, it refers to arg1::type, arg2::type, ..., argn::type.

Example

using namespace boost::mpl;

MPLLIBS_LAZY_METAFUNCTION(double_value, (N)) (times<int_<2>, N>));

[up]