From 765d9be17d1f677e2501e7a02ee968f5ffdc2b53 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Mon, 12 Feb 2001 04:53:39 +0000 Subject: [PATCH] small edit [SVN r9151] --- filter_iterator_example.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/filter_iterator_example.cpp b/filter_iterator_example.cpp index 3346e70..ce96334 100644 --- a/filter_iterator_example.cpp +++ b/filter_iterator_example.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -22,7 +23,7 @@ int main() int numbers[] = { 0, -1, 4, -3, 5, 8, -2 }; const int N = sizeof(numbers)/sizeof(int); - // Example using make_filter_iterator + // Example using make_filter_iterator() std::copy(boost::make_filter_iterator(numbers, numbers + N), boost::make_filter_iterator(numbers + N, numbers + N), std::ostream_iterator(std::cout, " ")); @@ -37,6 +38,14 @@ int main() std::copy(filter_iter_first, filter_iter_last, std::ostream_iterator(std::cout, " ")); std::cout << std::endl; + + // Another example using make_filter_iterator() + std::copy(boost::make_filter_iterator(numbers, numbers + N, + std::bind2nd(std::greater(), -2)), + boost::make_filter_iterator(numbers + N, numbers + N, + std::bind2nd(std::greater(), -2)), + std::ostream_iterator(std::cout, " ")); + std::cout << std::endl; return 0;