[MPL] Help with delayed placeholder expression evaluation
Hello !
I have been trying to work with the MPL but I have some problems with the
composition and argument binding concepts.
1/ Here is a problem I cannot find a solution for:
I would like to have a placeholder expression (S) which takes a single
argument which is itself a placeholder expression of 2 arguments (A).
I want S when invoked with mpl::apply to return a lambda expression (B) of 1
argument which when invoked on (x) would yield the same result than applying
the pair (x, x) to (A).
This means I expect apply == B and apply == apply.
Could someone tell me if this is possible? (I know how to do this without a
placeholder expression for (S) but I would like to improve my understanding
of them)
Typedef int_<1> one;
Typedef plus<_1, _2> A;
Typedef . S;
Typedef typename apply::type B;
BOOST_STATIC_ASSERT(apply::type::value == apply::type::value)
2/ Why doesn't bind take a placeholder expression ? If I want to remap a
placeholder expression, I can do for example:
bind
participants (1)
-
Thyfate