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.

Example

-In this example we print the positive number again, this time using -the make_filter_iterator() function. +In this example we print out all numbers in the array that are +greater than negative two. + +
+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(), -2)),
+	    boost::make_filter_iterator(numbers + N, numbers + N, 
+					std::bind2nd(std::greater(), -2)),
+	    std::ostream_iterator(std::cout, " "));
+  std::cout << std::endl;
+
+}
+
+The output is: +
+0 -1 4 5 8 
+
+ +

+In the next example we print the positive numbers using the +make_filter_iterator() function.

 struct is_positive_number {