Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] - Undocumented Predicates for filtered_graph
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-01-26 21:38:16


> 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_at_[hidden]



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