
"Eric Niebler" <eric@boost-consulting.com> writes:
Pavol Droba wrote:
Core of the range library is not in the code, rather in concepts that are defined there.
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