$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r78428 - trunk/boost/graph/detail
From: jewillco_at_[hidden]
Date: 2012-05-11 17:03:20
Author: jewillco
Date: 2012-05-11 17:03:19 EDT (Fri, 11 May 2012)
New Revision: 78428
URL: http://svn.boost.org/trac/boost/changeset/78428
Log:
Trying to fix undirected clear_vertex() again; refs #4622
Text files modified: 
   trunk/boost/graph/detail/adjacency_list.hpp |    35 ++++++++++++++++++++---------------     
   1 files changed, 20 insertions(+), 15 deletions(-)
Modified: trunk/boost/graph/detail/adjacency_list.hpp
==============================================================================
--- trunk/boost/graph/detail/adjacency_list.hpp	(original)
+++ trunk/boost/graph/detail/adjacency_list.hpp	2012-05-11 17:03:19 EDT (Fri, 11 May 2012)
@@ -981,22 +981,27 @@
       typedef typename Config::graph_type graph_type;
       typedef typename Config::edge_parallel_category Cat;
       graph_type& g = static_cast<graph_type&>(g_);
-      typename Config::OutEdgeList& el = g.out_edge_list(u);
-      typename Config::OutEdgeList::iterator
-        ei = el.begin(), ei_end = el.end();
-      for (; ei != ei_end; /* Increment below */ ) {
-        bool is_self_loop = (*ei).get_target() == u;
-        // Don't erase from our own incidence list in the case of a self-loop
-        // since we're clearing it anyway.
-        typename Config::OutEdgeList::iterator ei_copy = ei;
-        if (!is_self_loop) {
-          detail::erase_from_incidence_list
-            (g.out_edge_list((*ei).get_target()), u, Cat());
-          ++ei;
-        } else {
-          ++ei;
+      {
+        typename Config::OutEdgeList& el = g.out_edge_list(u);
+        typename Config::OutEdgeList::iterator
+          ei = el.begin(), ei_end = el.end();
+        for (; ei != ei_end; ++ei) {
+          bool is_self_loop = (*ei).get_target() == u;
+          // Don't erase from our own incidence list in the case of a self-loop
+          // since we're clearing it anyway.
+          if (!is_self_loop) {
+            detail::erase_from_incidence_list
+              (g.out_edge_list((*ei).get_target()), u, Cat());
+          }
+        }
+      }
+      {
+        typename Config::OutEdgeList& el = g.out_edge_list(u);
+        typename Config::OutEdgeList::iterator
+          ei = el.begin(), ei_end = el.end();
+        for (; ei != ei_end; ++ei) {
+          g.m_edges.erase((*ei).get_iter());
         }
-        g.m_edges.erase((*ei_copy).get_iter());
       }
       g.out_edge_list(u).clear();
     }