[BGL] - Undocumented Predicates for filtered_graph

In filtered_graph.hpp there appear to be a number of predefined predicates for general use (they are no in the detail namespace). One of them that I'd like to use is is_in_subset, but it appears that set_contains is not defined anywhere, not even for the most common case (std::set). Shouldn't Boost provide something like template <typename T, typename L, typename A, typename E> bool set_contains(const std::set<T, L, A> &s, const E &e) { return s.find(e) != s.end(); } and vice-versa for is_not_in_subset so that users don't have to open up the boost namespace and define it themselves? Thanks, --Michael Fawcett

In filtered_graph.hpp there appear to be a number of predefined predicates for general use (they are no in the detail namespace). One of them that I'd like to use is is_in_subset, but it appears that set_contains is not defined anywhere, not even for the most common case (std::set).
Shouldn't Boost provide something like
template <typename T, typename L, typename A, typename E> bool set_contains(const std::set<T, L, A> &s, const E &e) { return s.find(e) != s.end(); }
and vice-versa for is_not_in_subset so that users don't have to open up the boost namespace and define it themselves?
That's probably the aging effect of source code. There may have been a set_contains at one point (I had thought it would have been in pending/container_traits.hpp), but it seems to have disappeared. I'm not sure what do do here... It seems like there's a need for a set of generic algorithms (insert, find, nd erase) that operate on containers rather than their iterators, but it seems like it should be a top-level library. Andrew Sutton andrew.n.sutton@gmail.com

On Mon, Jan 26, 2009 at 9:38 PM, Andrew Sutton <andrew.n.sutton@gmail.com> wrote:
That's probably the aging effect of source code. There may have been a set_contains at one point (I had thought it would have been in pending/container_traits.hpp), but it seems to have disappeared.
I'm not sure what do do here... It seems like there's a need for a set of generic algorithms (insert, find, nd erase) that operate on containers rather than their iterators, but it seems like it should be a top-level library.
I went ahead and implemented my own is_in_subset struct for now. That way if you decide to remove it in the future (it is undocumented after all) I won't be affected. Thanks for your quick response, I'm asking you another question in a follow-up thread ;) --Michael Fawcett
participants (2)
-
Andrew Sutton
-
Michael Fawcett