This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/51823] reverse iterator instantiated with POD type returns uninitialized values + work around
- From: "marc.glisse at normalesup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 11 Jan 2012 15:16:58 +0000
- Subject: [Bug libstdc++/51823] reverse iterator instantiated with POD type returns uninitialized values + work around
- Auto-submitted: auto-generated
- References: <bug-51823-4@http.gcc.gnu.org/bugzilla/>
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.