|
Boost : |
Subject: Re: [boost] [Range] Confusing result of iterator_range::size()
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2011-11-03 08:08:39
Den 03-11-2011 11:04, Olaf van der Spek skrev:
> On Thu, Nov 3, 2011 at 11:00 AM, Thorsten Ottosen
> <thorsten.ottosen_at_[hidden]> wrote:
>>> Given that this has come up twice in the last month, I think it's worth
>>> discussing the fallout from such a change. If one were to redesign
>>> boost::iterator_range all over again, is there an argument *against*
>>> making
>>> size() return an unsigned type?
>>
>> Well, it used to return an unsigned type. It was then changed because
>
> What unsigned type?
either size_t or something like make_unsigned<>::type.
>> iterator traits have no notion of unsigned types.
>
>> And , AFAICR, there was a discussion about this on the list, convincing me
>> that using difference_type was the right thing to do.
>
> AFAIK the conclusion was the opposite: use make_unsigned.
If you can find it, I might believe you. It should be in the archieves
from some years ago.
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk