#include #include #include #include #include #include #include "Comprehension.h" using namespace std; int main(void) { vector a; //fill up the vector with a bunch of values - count_iterator used for convenience! std::copy(boost::counting_iterator(0), boost::counting_iterator(9), std::back_inserter(a)); typedef boost::function UnaryPred; typedef boost::function UnaryAdd; typedef Comprehension > VectorComprehension; VectorComprehension comprehension(UnaryAdd(bind(plus(),_1,5)), UnaryPred(bind(less(),_1,5)), a); VectorComprehension::ComprehensionIterator begin(comprehension.begin()); while(begin!=vectorComprehension.end()) { cout << *begin++; } }