Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2003-11-20 20:47:47


Brian McNamara wrote:
> On Thu, Nov 20, 2003 at 09:48:34AM -0800, John Torjo wrote:
>
>>>You may be interested to read
>>>
>>> http://groups.google.com/groups?q=brian+mcnamara+range+group:comp.lang.c%2B%2B.moderated+group:comp.lang.c%2B%2B.moderated&hl=en&lr=&ie=UTF-8&group=comp.lang.c%2B%2B.moderated&selm=8gm2i6%24gbt%241%40news-int.gatech.edu&rnum=5
>>>
>>
>>Yup, read it.
>>As a matter of fact, the range thing has been on my mind for quite a few
>>years as well.
>>
>>The crange class is (a little better) interval ;)
>>
>>However, I donot think that algorithms should operate on intervals, because
>>usually this makes harder for them to work.
>
>
> The way I see it, an "interval" or "range" or whatever is just an
> abstraction for a pair of iterators. You can have "range categories"
> just like "iterator categories", so that algorithms can take advantage
> of the specific propoerties of iterators/ranges. (E.g., some intervals
> may support random access, whereas other might not.)
>

Exactly! The "interval" or "range" is just a convenience.
However, there are times when having a 'traversal_range' (see my reply to
AlisdairM) does not imply two iterators.

Anyway, a traversal_range can be transformed into two iterators ;)

Best,
John


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