[Bug libstdc++/51823] reverse iterator instantiated with POD type returns uninitialized values + work around
marc.glisse at normalesup dot org
gcc-bugzilla@gcc.gnu.org
Wed Jan 11 15:17:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51823
--- Comment #7 from Marc Glisse <marc.glisse at normalesup dot org> 2012-01-11 15:16:58 UTC ---
Paolo started a discussion on this:
http://gcc.gnu.org/ml/libstdc++/2003-11/msg00089.html
but apparently the code wasn't changed. It is really sad that in most cases the
size of reverse_iterator is needlessly doubled just so some rare fancy
iterators can use it. And other fancy uses prevent from using a global instead
(even a tls).
For the special case of a Iota_iterator, when the C++ iterator concept is
eventually fixed (or for people who decide to ignore the requirement that
reference be a reference), reference should be int, not int const&, so
operator* would return by value.
More information about the Gcc-bugs
mailing list