Boost logo

Boost Users :

From: Sohail Somani (s.somani_at_[hidden])
Date: 2007-03-14 11:18:44


lambda doesn't provide for_each.

std::for_each(b,e,std::cout<< boost::lambda::_1 << '');

-----Original Message-----
From: boost-users-bounces_at_[hidden] on behalf of Darren Garvey
Sent: Wed 3/14/2007 6:43 AM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] how can I explicitly specify the lambda namespace
 
On 14/03/07, Dmitriy Chumack <saint.d.a_at_[hidden]> wrote:
> for_each(a.begin(), a.end(), std::cout << _1 << ' ');
>
> But how do I have to rewrite the above line of code to have it
> compiled without "using namespace boost::lambda;" before it?
>
> Thanks in advance.

This isn't really a boost question, but:
boost::lambda::for_each(a.begin, a.end(), std::cout<< _1 << '');
should work.



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