Boost.MPL: Is it possible to apply a variable substitution without evaluating the lambda-expression?

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
{};
The foldr metafunction is a strict version of Haskell's foldr, i.e.,
MPL's reverse_fold with parameters passed in the order that Haskell's
foldr passes parameters. The distinction isn't important for this
discussion, so don't dwell on that detail.
My intent is that if the lambda-expression is false for one of the types
in the sequence, then the lambda-expression applied to the "bad"
argument is printed in a compile-time error.
However, what gets printed is the result of the lambda-expression
applied to the bad argument: integral_constant
::type type;
...the first definition of mpl_assert prints the following uninformative
type in the displayed error:
boost::integral_constant

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
participants (2)
-
Luke Simon
-
Steven Watanabe