Boost logo

Boost Users :

Subject: [Boost-users] [Fwd: boost::bind vs. boost::lambda::bind - bug]
From: Chris Hite (C.Hite_at_[hidden])
Date: 2009-12-29 10:25:04


The code below fails to compile on g++ (GCC) 3.4.3:

lambda_bind_test.cxx:9: error: `_1' undeclared (first use this function)
lambda_bind_test.cxx:9: error: (Each undeclared identifier is reported
only once for each function it appears in.)

Commenting the include of boost::bind fixes it. How can the second
header hide types defined in the first header?

Shall I report a bug in trac or reopen this one?:
https://svn.boost.org/trac/boost/ticket/3075

Is there any way in the long run the two libraries could be unified?
All the asio examples use boost::bind? Should developers starting out a
new code base use just one? Which one?

#include <boost/lambda/bind.hpp>
#include <boost/bind.hpp> //comment this line out and it compiles

int foo(const char*);

void test(){
    using namespace boost::lambda;
    bind(foo,_1);
}


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