#define MPLLIBS_LAZY_METAFUNCTION(name, args) \
// unspecified
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>
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
.
using namespace boost::mpl;
MPLLIBS_LAZY_METAFUNCTION(double_value, (N)) (times<int_<2>, N>));
Copyright Abel Sinkovics (abel at elte dot hu) 2011. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt