Boost logo

Boost :

Subject: Re: [boost] [bind] Placeholders suggestion, std and boost
From: Edward Diener (eldiener_at_[hidden])
Date: 2015-05-25 08:57:24


On 5/25/2015 7:12 AM, Peter Dimov wrote:
> Glen Fernandes wrote:
>> I propose creating <boost/bind/bind.hpp>. Including it should result
>> in the placeholders being in boost::placeholders namespace.
>> <boost/bind.hpp> would now do nothing more than just include
>> <boost/bind/bind.hpp> and bring all the placeholders into the global
>> namespace.
>
> That's not a bad plan, but it would've been even better if
> boost/bind/bind.hpp didn't already exist. :-)

Maybe boost/bind/library.hpp ( or boost/bind/all.hpp )

>
>> #include <boost/bind/bind.hpp>
>>
>> using boost::placeholders::_1;
>
> I'm having a bit of trouble deciding between the above and
>
> using namespace boost::placeholders;
>
> The using declarations are closer to the current code and would be a
> better bet compatibility-wise, but the using directive seems more
> correct somehow.

As long as the boost::placeholders namespace consists of only the
declarations of _1 through _9, as in the current
boost/bind/placeholders.hpp, the using directive seems fine.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk