Lucio Flores writes:
So as an exercise, I'm trying to use a lambda expression that applies the first argument twice on it's second argument.
typedef mpl::apply<_1, mpl::apply<_1, _2>::type>::type twice_type;
I'm afraid this doesn't do what you think. Following a metafunction with '::type' means invoking it, so the above is basically equivalent to typedef mpl::apply<_1, _2>::type t; // == _1::apply<_2>::type == _2 typedef mpl::apply<_1,t>::type twice_type; // == _1::apply<t>::type == _1::apply<_2>::type // == _2
Then I instance this lambda function on boost::add_pointer and int
typedef mpl::apply
, int>::type result_type;
.. and, in its turn, this is equivalent to typedef mpl::apply<_2, boost::add_pointer<_1>, int>::type result_type; which gives you the result you refer to below.
But using boost::is_same, I've found that result_type==int, not int** as expected. Can someone see why?
HTH, -- Aleksey Gurtovoy MetaCommunications Engineering