public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41803]  New: Compiler forcing iterator to const
@ 2009-10-22 22:46 dont_spam_james at yahoo dot com
  2009-10-22 22:47 ` [Bug c++/41803] " dont_spam_james at yahoo dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dont_spam_james at yahoo dot com @ 2009-10-22 22:46 UTC (permalink / raw)
  To: gcc-bugs

In the source code there are two classes, Point and Edge.  A series of points
are stored in a std::multiset.  Edges are formed between the points, referenced
by multiset iterators.  The points are given pointers to the edge they are a
part of.

In the function Edge::splitEdge, an edge is broken up by a new point.  The
point is added to the multiset, a new edge is created, the edge's iterators are
reset, and the Edge pointers are reset.

When resetting the Edge pointers, the compiler is insisting that the data
contained in std::multiset<Point>::iterator is a const Point.

If I change the Point member data Edge *dp_edge to mutable and make the
Point::setEdge function const, the code compiles.


-- 
           Summary: Compiler forcing iterator to const
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dont_spam_james at yahoo dot com
 GCC build triplet: x84_64-unknown-linux-gnu
  GCC host triplet: x84_64-unknown-linux-gnu
GCC target triplet: x84_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41803


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-10-22 23:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-22 22:46 [Bug c++/41803] New: Compiler forcing iterator to const dont_spam_james at yahoo dot com
2009-10-22 22:47 ` [Bug c++/41803] " dont_spam_james at yahoo dot com
2009-10-22 22:53 ` dont_spam_james at yahoo dot com
2009-10-22 22:57 ` [Bug libstdc++/41803] " pinskia at gcc dot gnu dot org
2009-10-22 23:14 ` chris at bubblescope dot net
2009-10-22 23:22 ` paolo dot carlini at oracle dot com

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).