Subject: Re: [boost] [UTF String] UTF String library 1.5 ready for perusal
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2011-02-16 15:35:23
Sebastian Redl wrote:
> On 11.02.2011, at 20:36, Jeffrey Lee Hellrung, Jr. wrote:
> > 'Cause disallowing proxy references on random access traversal and
> > bidirectional traversal iterators...that sucks.
> IIRC, the issue was supposed to get addressed by the formal concepts
> for iterators. But when concepts were dropped, iterators reverted to
> their C++03 state, without any time remaining to bring in orthogonal
> iterator concepts.
If I understood Dave correctly, he is no longer convinced whether the orthogonal iterator concept would have been the correct solution.
I don't even understand the advantages of disallowing proxy references. What prevents generic code from just using
iterator_traits<Iterator>::reference when the (proxy-) reference returned from an iterator must be saved temporarily? What I can understand is to require that the iterators from the standard containers should not use proxy references, because it would force iterator_traits<iterator_type>::reference into normal non-generic user code. As many "normal" users might be not too familiar with "iterator_traits", it is desirable to avoid that situation.
However, if some algorithms of an stl implementation have difficulties with iterators returning proxy references, I think it is something that could easily be fixed if some standard would say that proxy references are allowed.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk