Boost logo

Boost Users :

From: Jens Theisen (jth02_at_[hidden])
Date: 2006-09-24 15:47:20


Hello,

I'm wondering what the reference member in the iterator_traits of an
iterator is required to be. I couldn't find any requirement at all in
the C++98 standard, and more surprisingly, I can't see any requirement
in the new iterator proposal either.

In particular, operator* does not seem to be required to return the
iterator_traits< Iterator >::reference for lvalue iterators.

At one point, however, the proposal suggests that this was the
intention:

"...would have a return type of reference; the same as operator*."

where reference has a font style indicating that it's the
iterator_traits's notion of reference.

I'm looking at the proposal version currently published along in the
documentation of the boost iterator library.

So my questions:

- Am I right in my suspicion that in the STL, the reference
  iterator_trait is entirely useless if taken strictly?

- Should the proposal not better require the reference to match with
  operator*'s return type for lvalue iterators? If not, what's its
  use?

- Is this off-topic here? :)

Regards,

Jens


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