Boost logo

Boost :

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


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

<snip>

> 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
> unqualified...in 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: http://lists.boost.org/boost-users/2005/03/10242.php)

See http://lists.boost.org/boost-users/2005/03/10391.php 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: http://boost.org/libs/range/doc/range.html. 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
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