
AMDG Luke Simon wrote:
I am using BOOST_MPL_ASSERT to assert a lambda-expression applied to a sequence of types by folding the lambda-expression onto a sequence of types (see code and continue discussion below).
template
struct mpl_assert { typedef typename apply ::type type; BOOST_MPL_ASSERT((type)); }; template
struct assert_for_all : foldr< mpl_assert , true_, xs {};
<snip>
...but what I want to have printed is the type:
boost::is_same
Boost.MPL is already calculating such a type, because apply
, bar> returns is_same ::type, so the needed type is there... but does Boost.MPL provide a means of accessing it as opposed to accessing its ::type field?
MPL doesn't provide such a metafunction. Note that MPL doesn't
actually calculate this in the process of evaluating lambda expressions,
because
of nesting. For example, is_same