namespace qi = boost::spirit::qi; using enc::alnum; bool r = phrase_parse( first, /*< start iterator >*/ last, /*< end iterator >*/ alnum[ boost::phoenix::ref(std::cout) << "Read: " << qi::_1 << std::endl ], /*< the parser >*/ space /*< the skip-parser >*/ );