Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-09-01 09:35:37


"Eric Niebler" <eric_at_[hidden]> writes:

> Pavol Droba wrote:
>
>> Core of the range library is not in the code, rather in concepts that are defined
>> there.
>>
>> http://boost.org/libs/range/doc/range.html
>>
>
>
> In that case, the Range library and the concepts it defines are
> fundamentally broken. It seems to be requiring that everybody at all
> times make qualified calls to boost::begin() and boost::end().
> Therefore, in order to extend the library, users must put *their*
> begin() and end() functions in the boost namespace. This is distasteful,
> but I'll let that slide.

Don't. It's worse than distasteful: it doesn't work.

> The more serious problem is the way this interacts with 2-phase
> lookup.

Right, that's why it doesn't work. 2-phase lookup is in the language,
and anything that doesn't cooperate is broken.

> Since it is a qualified call, any call to boost::begin() from within a
> template will get resolved during the first lookup phase. If a user's
> overload has not been seen yet, it will not get considered.
>
> So, is Boost.Range broken, or is this another problem with the
> documentation?

If Boost.Range is about concepts, those amount to the same thing.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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