Boost logo

Boost :

From: Joe Van Dyk (joevandyk_at_[hidden])
Date: 2006-07-27 20:11:44


I have Boost 1.33.1 installed. I'm trying to use Boost.Lamda.

I included all the headers mentioned in the documentation as an
attempt to fix the compile error.

#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>
#include <boost/lambda/loops.hpp>
#include <boost/lambda/algorithm.hpp>
#include <boost/lambda/if.hpp>
#include <boost/lambda/switch.hpp>
#include <boost/lambda/construct.hpp>
#include <boost/lambda/casts.hpp>
#include <boost/lambda/exceptions.hpp>
#include <iostream>
#include <list>

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

   list<int> v(10);
   for_each(v.begin(), v.end(), _1 = 1);
}

% g++ lambda.cpp
lambda.cpp: In function `int main()':
lambda.cpp:20: error: `_1' undeclared (first use this function)
lambda.cpp:20: error: (Each undeclared identifier is reported only once for
   each function it appears in.)

Using gcc 3.3.1.

Any ideas?

Thansk,
Joe


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