public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/51560] New: std::set<T>::cbegin()/cend() etc. return iterator instead of const_iterator
@ 2011-12-15 0:42 carsten_neumann at gmx dot net
2011-12-15 1:07 ` [Bug libstdc++/51560] " redi at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: carsten_neumann at gmx dot net @ 2011-12-15 0:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51560
Bug #: 51560
Summary: std::set<T>::cbegin()/cend() etc. return iterator
instead of const_iterator
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: carsten_neumann@gmx.net
Created attachment 26096
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26096
Trivial (untested) patch
The return type of the member functions cbegin,cend,crbegin,crend for std::set
and std::multiset are wrong, they should be
const_iterator/const_reverse_iterator respectively.
Attaching the trivial patch (untested).
I don't have copyright assignment, but since the patch is trivial and only
changes a few lines I'm hoping it's not needed.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug libstdc++/51560] std::set<T>::cbegin()/cend() etc. return iterator instead of const_iterator
2011-12-15 0:42 [Bug libstdc++/51560] New: std::set<T>::cbegin()/cend() etc. return iterator instead of const_iterator carsten_neumann at gmx dot net
@ 2011-12-15 1:07 ` redi at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2011-12-15 1:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51560
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-12-15 01:02:32 UTC ---
It's the same type, as permitted by the standard:
"For associative containers where the value type is the same as the key type,
both iterator and const_iterator are constant iterators. It is unspecified
whether or not iterator and const_iterator are the same type."
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-15 1:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-15 0:42 [Bug libstdc++/51560] New: std::set<T>::cbegin()/cend() etc. return iterator instead of const_iterator carsten_neumann at gmx dot net
2011-12-15 1:07 ` [Bug libstdc++/51560] " redi at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).