Simply including boost/bind.hpp causes compilation error

Here is my environment.
% g++ -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5483~1/src/configure
--disable-checking -enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=i686-apple-darwin9 --with-arch=apple --with-tune=generic
--host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5483)
Boost 1.35.0
(also produced same issue with Boost 1.34.1)
Here is the code.
1 #include

AMDG Ken Smith wrote:
Boost.Bind declares the placeholders _1, _2, etc at global scope. Boost.Lambda declares the placeholders _1, _2, and _3 in namespace boost::lambda. The use of _1 in this context is ambiguous. Try qualifying it. namespace bll = boost::lambda; (bll::_1 * 3) In Christ, Steven Watanabe

Steven Watanabe
Boost.Bind declares the placeholders _1, _2, etc at global scope.
We discussed this years ago. AFAICR Dave Abrahams terminated the discussion with a statement that clearly considered _1 in global namespace as a design error. At least this is how I understood his statemment. So here again someone falls over this. Years go by and nasty little oddities remain unfixed and - worse - undocumented (similar to multi_array not modeling Assignable like any good C++ container in this world). I would like to revoke this discussion in order to get this fixed once for all times: How and when can we get rid of _1 and bretheren in global namespace? Having bll be a second class citizen has driven me crazy more than once, letting me put explicit namespace prefixes everywhere, no longer using Koenig lookup anywhere. Of course the vicinity of fusion/phoenix/xpressive/proto complicates the situation, but we can fix this. std::tr1::placeholders::_1 points into the right direction. I am thinking of something like boost::placeholders::_, ...::_1, etc. So maybe the answer to all this is <http://www.boost.org/doc/libs/1_35_0/doc/html/boost_tr1/ subject_list.html#boost_tr1.subject_list.bind>, but please, please remove *anything* from global namespace for boost-1.36 and tag boost::has_evolved_to_tr1* libs as deprecated in favor to the standardized version. Markus

Looks like you might be using the wrong bind.
Instead of the following header:
#include
-- View this message in context: http://www.nabble.com/Simply-including-boost-bind.hpp-causes-compilation-err... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (4)
-
atifm
-
Ken Smith
-
Markus Werle
-
Steven Watanabe