Boost logo

Boost :

From: Brock Peabody (brock.peabody_at_[hidden])
Date: 2004-08-27 07:50:11


> On Behalf Of zaufi

> Can anybody shed a light on what are we doing wrong in this example?

Try:

#include <list>
#include <algorithm>
#include <boost/lambda/bind.hpp>
#include <boost/lambda/lambda.hpp> //added

int main()
{
    using namespace boost::lambda;

    std::list<std::list<int> > l;
    bool some_are_empty = false;

    std::for_each(l.begin(), l.end(), var(some_are_empty) =
bind(&std::list<int>::empty, _1) || var(some_are_empty));
                                    ^^^^ ^
    return 0;
}


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk