Boost logo

Boost :

Subject: Re: [boost] [range] Can iterator_range also model Random Access Range?
From: Mostafa (mostafa_working_away_at_[hidden])
Date: 2013-12-08 03:09:33


On Wed, 04 Dec 2013 01:26:10 -0800, Thorsten Ottosen
<thorsten.ottosen_at_[hidden]> wrote:

>
> Yes, of course. The underlying iterator's just needs to be random access.
>
> regards
>
> -Thorsten

Unfortunately, and respectfully, that is not at all clear from either
docs, please reread range/reference/utilities/iterator_range.html and
range/reference/utilities/sub_range.html. The latter defers to the former,
and all the former states about range concepts is: "The intention of the
iterator_range class is to encapsulate two iterators so they fulfill the
Forward Range concept". And, obviously, just because some type fulfills
the Forward Range concept does not mean that it fulfills refinements
thereof. Additionally, there is no indication in the iterator_range doc if
the underlying iterator models refinements of the Forward Iterator
concept, than its corresponding iterator_range class also models analogous
refinements of the Forward Range concept. A statement along the lines of
the last sentence added to the iterator_range doc would go a long way
towards clarifying this, else one is left with being forced to deduce this
fact.

Mostafa


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