Boost logo

Boost Users :

Subject: [Boost-users] boost-introduced ambiguity in _1/_2 etc.
From: Piotr Wyderski (piotr.wyderski_at_[hidden])
Date: 2012-02-10 02:41:28


I am refactoring our application which uses boost extensively
in order to replace some boost-provided entities with their
std counterparts defined in the C++11 standard. I've experienced
a problem related to boost::bind placeholders defined in
placeholders.hpp. The file begins with:


static inline boost::arg<1> _1() { return boost::arg<1>(); }

unconditionally injecting the _N() functions into the global
namespace scope. When I type "using namespace std::placeholders;"
in order to use e.g. std::placeholders::_1, an unsolvable ambiguity
occurs, as there is no way to transfer the boost-defined variants
into an uncolliding namespace. Could you please add a macro in 1.49
which would allow me to override the default behaviour and define
the functions in boost:: or boost::placeholders namespaces?

     namespace boost {
     namespace {


     Best regards, Piotr

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at