#include #include #include //for isprint #include //for numeric_limits #include //for class string #include //for ptr_fun #include //for compose1 #include //for generate_n, remove_if #include "pointer_to_unary_function_ref.h" #include "counter.h" #include "convert.h" using namespace std; int main() { typedef numeric_limits limits; string s; generate_n( back_inserter(s), limits::max() - limits::min() + 1, counter(limits::min()) ); const string::iterator it = remove_if( s.begin(), s.end(), not1(__gnu_cxx::compose1( ptr_fun(static_cast(isprint)), ptr_fun(convert) )) ); s.erase(it, s.end()); cout << s.substr(0, 60) << "\n" << s.substr(60) << "\n"; return EXIT_SUCCESS; }