Subject: Re: [boost] [Iterator][MultiIndex]iterator-specificpartition_point-related functions
From: David Abrahams (dave_at_[hidden])
Date: 2008-11-28 11:08:10
on Fri Nov 28 2008, Arno SchÃ¶dl <aschoedl-AT-think-cell.com> wrote:
>> Your BOOST_CUSTOM_PARTITION macro overloads lower_bound, etc
>> for the iterator type of interest: as far as I can see, this is not
>> since boost::lower_bound could use partition_point through ADL, which is
>> the only customization point we need. To put it more succintly,
>> why can't you just have
> This would require the user to specify "using boost::lower_bound" if he wants to
> implement a custom_partition for one of his own iterators outside namespace boost,
Why do you say that a using declaration is needed? What's wrong with
calling lower_bound with qualification?
> This may lead to ambiguities between std::lower_bound and boost::lower_bound if
> other non-boost libraries do
> using std::lower_bound;
> lowerbound( ... ) // unqualified, the well-intentioned implementor wants to allow ADL
> The Visual Studio 2008 std library makes such unqualified calls, so it suffers from
> this ambiguity.
I don't see a problem. boost::lower_bound can be implemented inside
namespace boost::lower_bound_:: and brought out with a using declaration
so there's no ADL conflict.
Note also that we have boost/detail/binary_search.hpp, for what it's worth.
-- Dave Abrahams BoostPro Computing http://www.boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk