Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2005-09-02 10:40:19

Thorsten Ottosen wrote:
> Eric Niebler <eric <at>> writes:
>>Please enlighten me as to the proper way
>>to extend your library.


> way 2: (lacking from docs)
> (a) provide free-standing member in namespace of the UDT:
> - begin()
> - end()
> - size()
> (b) provide specializations for
> - boost::range_itetator
> - boost::range_const_iterator
> - boost::range_value
> - boost::range_difference
> - boost::range_size
> A library might choose not to call boost::begin/end/size
> which case that library does not support
> UDTs.
> Does it make sense? Have I forgotten something?

It does *not* make sense, and I think you forgot the long discussion we
had on this topic with Dave A. and Peter D. on the boost.users list.
(Thread starts here:

See where you wrote:

"So this changes the extension protocol to overloading adl_end() from
overloading end()."

You also seem to be forgetting the Range concepts that you yourself
documented here: In the
concepts, the calls to begin()/end() are REQUIRED to be qualified.

So I'll ask again, what is the proper way to extend your library?

While we're on the topic, what is the point of range_value,
range_difference and range_size? Will range_value<Range>::type ever be
different than
std::iterator_traits<range_iterator<Range>::type>::value_type? If the
answer is no, then why do we need range_value?

Eric Niebler
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at