Boost Users :
Subject: [Boost-users] [Graph] edge_range() with hash_setS as OutEdgeList in adjacency_list
From: Ignacy Gawedzki (ibugs_at_[hidden])
Date: 2009-03-04 14:20:19
The following issue seems to have been discussed on this list a while ago, but
nothing seems to have changed since and I was usable to find a proper answer
The edge_range() function uses std::equal_range() to extract a pair of
iterators to the edges of interest. The problem lies in the fact that
according to the SGI STL documentation, std::equal_range() requires the
entries to be sorted (although I found no explicit mention of that in the
standard). With hash_setS as OutEdgeList in adjacency_list, the entries are
obviously not sorted, and std::equal_range() must not be used.
While it's easy to write an edge_range_custom() function that would call the
equal_range() method instead of the global function, nothing can be done to
prevent the use of the original edge_range() by other library code like
overloaded methods are called from within remove_edge() which apparently
causes trouble with hash_setS. I tried myself to overload the original
edge_range(), for the case where hash_setS is used, but the solution is far
from elegant and it feels like something be better done upstream.
What do you think about that? Shouldn't the equal_range() method be used
directly instead of std::equal_range() in any case?
Thanks for your help.
-- /* This is not a comment */
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net