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

Joel de Guzman <[email-masked]> writes:

> Consider this:
>
>      std::vector<std::vector<int> > v;
>      ...
>      for_each(arg1, for_each(arg1, cout << arg1 << ' '))
>      (v);
>
> Prints all the elements of v.

Actually that case is kind of strange.  I think in MPL we're deciding
that you need to do something like:

  for_each(arg1, function(for_each(arg1, cout << arg1 << ' ')))(v)

to prevent v from being substituted into *all* of the arg1s.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com