[BGL] clear_out_edges and MutableIncidenceGraph

Hi, adjacency_list implements clear_out_edges, but it's not required by any of the graph concepts: http://www.boost.org/doc/libs/1_46_1/libs/graph/doc/graph_concepts.html Could it be added to MutableIncidenceGraph? Actually, now that I check, I don't see MutableIncidenceGraph on that page either, although it is in graph_concepts.hpp. MutableIncidenceGraph requires remove_edge and remove_out_edge_if. clear_out_edges would fit nicely in here, and clear_in_edges in MutableBidirectionalGraph. Cheers, Shaun

On Tue, 22 Mar 2011, Shaun Jackman wrote:
Hi,
adjacency_list implements clear_out_edges, but it's not required by any of the graph concepts: http://www.boost.org/doc/libs/1_46_1/libs/graph/doc/graph_concepts.html
Could it be added to MutableIncidenceGraph? Actually, now that I check, I don't see MutableIncidenceGraph on that page either, although it is in graph_concepts.hpp. MutableIncidenceGraph requires remove_edge and remove_out_edge_if. clear_out_edges would fit nicely in here, and clear_in_edges in MutableBidirectionalGraph.
The problem with that is code might have been written with the previous definitions of the concepts, and that code would break if we added requirements. You can use remove_out_edge_if with a predicate that always returns true to emulate the behavior, but you'd really want to use a sizeof trick to find out if there is an actual clear_out_edges function first. -- Jeremiah Willcock
participants (2)
-
Jeremiah Willcock
-
Shaun Jackman