fixing the removal of edges

for/release
dmatetelki 11 years ago
parent 53f5f14af6
commit b19eda3a48

@ -371,9 +371,11 @@ inline void Graph<V, E>::Vertex::removeEdge(const_reference destination, const_w
template <typename V, typename E>
inline void Graph<V, E>::Vertex::removeAllEdgesTo(const_reference destination)
{
m_edges.erase(
std::remove_if(m_edges.begin(), m_edges.end(),
[&destination](const EdgeTo& e)
{ return *e.m_destination == destination; });
{ return *e.m_destination == destination; }),
m_edges.end());
}
template <typename V, typename E>
@ -472,7 +474,7 @@ inline bool Graph<V, E>::removeAllEdges(const_reference source, const_reference
return false;
(*source_it).removeAllEdgesTo(destination);
if (m_directed)
if (!m_directed)
(*destination_it).removeAllEdgesTo(source);
return true;

Loading…
Cancel
Save