Boost logo

Boost :

Subject: Re: [boost] [iterator] iterator-category logic
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-04-21 17:12:42

On Thu, Apr 19, 2012 at 5:09 AM, Sebastian Redl <
sebastian.redl_at_[hidden]> wrote:

> On 18.04.2012 10:20, Jeffrey Lee Hellrung, Jr. wrote:
>> For better or for worse, the present logic in iterator_facade is strictly
>> (more or less) correct given the C++03 iterator requirements, but I just
>> looked up the N3290 draft of C++11 and it appears that any requirements
>> that *i return a real reference have been dropped, thus allowing for proxy
>> references in all iterator categories.
>> (a) Am I interpreting the C++11 iterator requirements correctly?
>> I'm afraid not. I can only quote N3376 (the first draft of C++1y) right
> now, but it says in the requirements for forward iterators (24.2.5p1):
> "if X is a mutable iterator, /reference/ is a reference to T; if X is a
> const iterator, /reference/ is a reference
> to const T,"
> where /reference/ refers to iterator_traits<X>::reference.
> And of course the primary Iterator requirements specify that *r returns
> iterator_traits<X>::reference.
> The change in iterator requirements was supposed to piggy-back on
> concepts; when they were removed, so were the iterator changes. They
> basically haven't changed since C++03.

:: sad face ::

Thanks for checking this more thoroughly than I did :/

Sorry for the noise,

- Jeff

Boost list run by bdawes at, gregod at, cpdaniel at, john at