Boost logo

Boost Users :

Subject: Re: [Boost-users] boost solution for transforming stl algorithms on proxy iterators?
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-10-17 07:26:13


On Wed, Oct 17, 2012 at 4:10 AM, Oswin Krause <
Oswin.Krause_at_[hidden]> wrote:

> Hi,
>
> C++ requires it to be `iterator_traits<Iterator>::**reference`, I
>> thought, or does it require it to be real reference like
>> `iterator_traits<Iterator>::**value_type&`?
>>
>
> The first is a requirement for every iterator. However, there are a few
> more lines written in pure standardese which are described in the
> boost.iterator docu:
>
> http://www.boost.org/doc/libs/**1_51_0/libs/iterator/doc/new-**
> iter-concepts.html#motivation<http://www.boost.org/doc/libs/1_51_0/libs/iterator/doc/new-iter-concepts.html#motivation>
>
> "Value Access Requirements in Existing Iterator Categories:
> [..]
> Forward Iterator *i is T&"
>
> where T is the value_type of the iterator.
>

Just to be technically accurate, T const & is also acceptable, of course;
but otherwise, yes, a real reference is still technically required by the
standard for forward iterators.

- Jeff



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net