// fo/compose2.cpp #include #include #include #include #include "print.hpp" #include "compose21.hpp" using namespace std; int main() { vector coll; // Вставка элементов со значениями от 1 до 9 for (int i=1; i<=9; ++i) { coll.push_back(i); } PRINT_ELEMENTS(coll); // Удаление всех элементов, больших 4, но меньших 7 // - retain new end vector::iterator pos; pos = remove_if (coll.begin(),coll.end(), compose_f_gx_hx(logical_and(), bind2nd(greater(),4), bind2nd(less(),7))); // Стирание "удаленных" элементов из коллекции coll.erase(pos,coll.end()); PRINT_ELEMENTS(coll); }