diff --git a/test/input_iterator.cpp b/test/input_iterator.cpp index 005d393d..0eb5c109 100644 --- a/test/input_iterator.cpp +++ b/test/input_iterator.cpp @@ -8,25 +8,26 @@ #include #include #include -#include -#include -#include using namespace boost::python; typedef std::list list_int; -// Prove that we can handle InputIterators which return rvalues. This -// input iterator example was stolen from the iterator_adaptors -// documentation -typedef std::binder1st > doubler; +// Prove that we can handle InputIterators which return rvalues. +struct doubler +{ + typedef int result_type; + int operator()(int x) const { return x * 2; } +}; + typedef boost::transform_iterator_generator::type doubling_iterator; typedef std::pair list_range2; + list_range2 range2(list_int& x) { return list_range2( - boost::make_transform_iterator(x.begin(), std::bind1st(std::multiplies(),2)) - , boost::make_transform_iterator(x.end(), std::bind1st(std::multiplies(),2))); + boost::make_transform_iterator(x.begin(), doubler()) + , boost::make_transform_iterator(x.end(), doubler())); } // We do this in a separate module from iterators_ext (iterators.cpp)