Boost logo

Boost Users :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2005-10-10 04:22:45


Geoffrey Romer writes:
> On 10/5/05, Aleksey Gurtovoy <agurtovoy_at_[hidden]> wrote:
>> Geoffrey Romer writes:
>> > Suppose I'm tying to build a nested lambda expression, like so
>> > (typename...::type omitted for simplicity):
>> >
>> > lambda<higher_order_func<lambda<foo<_1> >, _2> >
>> > ...
>> > - Does the _1 refer to the first argument of the inner lambda, or of
>> > the outer lambda?
>>
>> The outer one.
>
> Is that also true if the inner lambda were a bind?

No, bind expressions are passed through 'lambda' untouched. From
http://cvs.sourceforge.net/viewcvs.py/boost/boost/libs/mpl/test/apply.cpp?rev=1.5&view=markup:

    MPL_TEST_CASE()
    {
        typedef bind2<plus<>,_1,_1> b1;
        typedef lambda<b1>::type b2;
        MPL_ASSERT(( is_same< b1,b2 > ));
    }

HTH,

-- 
Aleksey Gurtovoy
MetaCommunications Engineering

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net