Boost logo

Boost :

Subject: Re: [boost] [Range] Confusing result of iterator_range::size()
From: Olaf van der Spek (ml_at_[hidden])
Date: 2011-11-07 05:08:52


On Mon, Nov 7, 2011 at 10:11 AM, Thorsten Ottosen
<thorsten.ottosen_at_[hidden]> wrote:
> Den 05-11-2011 21:23, Dave Abrahams skrev:
>>
>> on Sat Nov 05 2011, Olaf van der Spek<ml-AT-vdspek.org>  wrote:
>
>>> So boost::iterator_range::size() and boost::size() violate this?
>>
>> I don't have the spec in front of me, but that's my understanding from
>> the foregoing conversation.
>
> Well, iterator_range<T> is not a container. Could you elaborate on your
> view?

1. The intention of the iterator_range class is to encapsulate two
iterators so they fulfill the Forward Range concept.
2. Size type
boost::range_size<X>::type
An unsigned integral type that can represent any nonnegative value of
the Range's distance type.

1. http://www.boost.org/doc/libs/1_47_0/libs/range/doc/html/range/reference/utilities/iterator_range.html
2. http://www.boost.org/doc/libs/1_47_0/libs/range/doc/html/range/concepts/forward_range.html


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