libstdc++/5583: std::set::iterator is readonly

Carlo Wood
Tue Feb 5 07:38:00 GMT 2002

On Tue, Feb 05, 2002 at 02:56:09PM -0000, wrote:
> Synopsis: std::set::iterator is readonly
> State-Changed-From-To: open->feedback
> State-Changed-By: rodrigc
> State-Changed-When: Tue Feb  5 06:56:09 2002
> State-Changed-Why:
>     Your testcase in the "How-to-Repeat" section is
>     incorrect and doesn't even compile.
>     Can you submit a full testcase (including #include statements)
>     which illustrates your problem?

I didn't look at the PR, but from the Subject I bet that
he means that (*iter) returns a constant object, even
for set<Non-Const-Type>::iterator.

If so, then this is not a bug: the elements of set<> have to be
constant, you are not allowed to change them because that would
change the ordering in the set<>.

Carlo Wood <>

More information about the Gcc-bugs mailing list