On Wed, Oct 17, 2012 at 4:10 AM, Oswin Krause <Oswin.Krause@ruhr-uni-bochum.de> 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

"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