diff --git a/filter_iterator.htm b/filter_iterator.htm index 3010f9d..f71118e 100644 --- a/filter_iterator.htm +++ b/filter_iterator.htm @@ -189,8 +189,32 @@ This function provides a convenient way to create filter iterators.
+int main() +{ + int numbers[] = { 0, -1, 4, -3, 5, 8, -2 }; + const int N = sizeof(numbers)/sizeof(int); + + std::copy(boost::make_filter_iterator(numbers, numbers + N, + std::bind2nd(std::greater+The output is: +(), -2)), + boost::make_filter_iterator(numbers + N, numbers + N, + std::bind2nd(std::greater (), -2)), + std::ostream_iterator (std::cout, " ")); + std::cout << std::endl; + +} +
+0 -1 4 5 8 ++ +
+In the next example we print the positive numbers using the +make_filter_iterator() function.
struct is_positive_number {