Subject: Re: phoenix lambda-lambda for_each example
From: Aleksey Gurtovoy <[email-masked]>
To: Joel de Guzman <[email-masked]>
Cc: David Abrahams <[email-masked]>, Noah Stein <[email-masked]>, [email-masked], Jaakko Jarvi <[email-masked]>
Date: Tue, 02 Mar 2004 22:15:55 -0600

Joel de Guzman writes:
> Aleksey Gurtovoy wrote:
>> What if I don't want the scope there?
>>     std::vector<int> v1, v2;
>>     copy( arg1, back_inserter(arg2) )(v1, v2); // fails???
>
> No, that's ok! Why? because copy does not require a lambda-lambda.
> The signature of for_each is: for_each(c, lambda) while the signature
> of copy is simply copy(c, c).

OK, 'copy' is not very interesting then. Hopefully this one
demonstrates my question better:

    for_each( v1, push_back(arg1, arg1) )( v2 ); // works?
    for_each( arg1, push_back(arg2, arg1) )( v1, v2 ); // doesn't, right?

Actually, the latter is not achievable even with explicit scoping, so
I guess it's not the question of explicit vs. implicit scopes, but
rather how to override the default behavior.

-- 
Aleksey Gurtovoy
MetaCommunications Engineering