Opened 16 years ago
Closed 16 years ago
#682 closed Bugs (Fixed)
Constness in iterator_facade::operator->
Reported by: | ras52 | Owned by: | david_abrahams |
---|---|---|---|
Milestone: | Component: | iterator | |
Version: | None | Severity: | |
Keywords: | Cc: |
Description
The C++ standard states (table 72) that for an input iterator, a->m is equivalent to (*a).m. If operator* returns a value_type by non-const value, it is possible to call a non-const member function on the temporary returned from the function. However, the operator_arrow_proxy class acts as a proxy to T const* rather than T*, this that you can do (*i).non_const_method(); but not i->non_const_method(); for certain input iterators. See discussion here: http://lists.boost.org/Archives/boost/2006/07/107713.php http://lists.boost.org/Archives/boost/2006/07/107740.php http://lists.boost.org/Archives/boost/2006/07/107756.php
Note:
See TracTickets
for help on using tickets.