|
Boost : |
From: Joe Van Dyk (joevandyk_at_[hidden])
Date: 2006-07-28 01:04:29
On 7/27/06, Kevin Spinar <spinarkm_at_[hidden]> wrote:
> On 7/27/06, Joe Van Dyk <joevandyk_at_[hidden]> wrote:
> > 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>
>
> [snip unneeded includes]
>
> #include <algorithm>
>
> > #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
>
> you should compile with -W -Wall -pedantic -ansi at a minimum.
>
> > 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.
>
> Consider upgrading to gcc 4. With gcc 4, I get:
>
> error: namespace 'boost::lambda' not allowed in using-declaration
Ah, thanks. I needed
using namespace boost::lambda;
Joe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk