Boost logo

Boost :

From: Gary Powell (Gary.Powell_at_[hidden])
Date: 2001-07-26 12:31:34

[Jeremy Siek]
Another issue is that I'd like to be able to use these kinds of functions
with the graph library. The graph library uses functions that return pairs
of iterators. I want to be able to write this:

find_if(edges(g), is_residual_edge());

// edges() returns pair<edge_iterator,edge_iterator>

[Gary Powell]
  What if you had a make_range which took a std::pair?

template<typename Iterator>
range<Iterator> make_range(std::pair<Iterator, Iterator> const &rhs)
   return range<Iterator>(rhs.first, rhs.second);

then at least you write.
find_if (make_range(edges(g)), is_residual_edge() );




Boost list run by bdawes at, gregod at, cpdaniel at, john at