Boost logo

Boost :

Subject: Re: [boost] Is Boost.Range broken?
From: Pete Bartlett (pete_at_[hidden])
Date: 2008-11-22 06:46:38


-----Original Message-----
From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
On Behalf Of Dave Handley

>Personally, reading this entire thread, I find the proposal by both Tomas
>Puverle and David Abrahams that 2 versions of iterator_range exist, one
>that
>tests for singularity and one that doesn't, by far the most palatable
>solution. It allows you to have a lean and mean iterator_range if you want

to store lots of them in a container (the use case that Dave talks about),
>it also allows you to have an empty range when you need an iterator_range
>to
>look like a container. This could be trivially implemented with
>inheritance
>or a policy template. It would be a nice solution to the problem from both

>directions, and I think it makes the most sense.

>Dave

Thinking of two versions, another point to consider is the existence of
sub_range.

Whilst I can see that it seems fairly natural for iterator_range<iterator_t>
to have iterator-like behaviour, what about when it is phrased as
sub_range<container_t> ? At the moment this is also iterator-like but if you
were working from intuition rather than from docs, users could also easily
guess it is container-like.


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