|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-06-21 14:05:46
Reece Dunn wrote:
> David Abrahams wrote:
>>
>>> In an expression of the form f(x, y), f is (also)
>>> looked up in the ("associated") namespaces of x and y. Since _1 is
>>> usually of type boost::arg<1>, boost is an associated namespace for
>>> it and the function "bind" is found without an explicit boost::
>>> qualification.
>>
>> Depending on your point of view, this might be an argument for moving
>> the placeholders into a nested namespace (with a using directive to
>> bring them out, of course).
>
> That would be consistent with TR1 that has them in the
> std::tr1::placeholder
> namespace. It may also be useful to merge the bind and lambda placeholders
> to avoid issues with using lambda with bind.
It is the boost:: in boost::arg<1> that causes ADL to look into boost. It
doesn't matter where the placeholders themselves are declared (in the
unnamed namespace currently). One might make the case for
boost::_bi::arg<1>, I suppose.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk