#include #include #include #include #include #include #include "t_iterator.h" using namespace std; inline bool isprime(int n) { return n >= 2 && find_if( t_iterator(2), t_iterator(n), __gnu_cxx::compose1( bind2nd(equal_to(), 0), bind1st(modulus(), n) ) ) == t_iterator(n); } int main() { remove_copy_if( t_iterator(1), t_iterator(30), ostream_iterator(cout, "\n"), not1(ptr_fun(isprime)) ); return EXIT_SUCCESS; }