Boost logo

Boost Users :

From: Markus Werle (yg-boost-users_at_[hidden])
Date: 2003-01-27 05:57:50


Hi!

the placeholders in boost/bin/placeholders.hpp
are put in an anonymous namespace.

This is awkward, since like this they are visible
even in places where I do not want them to be so, e.g.:

#include <all_of_boost_lambda>
#include <all_of_boost_function> // not unlikely to use both

[...]

{
using namespace boost::lambda;
std::for_each(v.begin(), v.end(), std::cerr << _1 << constant(' '));
}

In such cases the "_1" is ambigous, since
boost::lambda::_1 and and <anonymous>::_1
are both visible. This means that code which used to include
boost_lambda stuff may change its meaning (or get ambigous) just
by including another boost header.

Could we not place those placeholders into namespace boost,
just to get rid of the ambiguity?
Any caveats I overlooked?

(using my own placeholder definitions and BOOST_BIND_NO_PLACEHOLDERS
is not really a satisfying solution)

Markus


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