// clang++ -std=c++98 -Wall -Wextra -pedantic -I ~/Documents/Ordi/boost-trunk -o main main.cpp #include #include #include // Note how the return is made by value instead of by reference. template T identity(T const& t) { return t; } int main() { namespace karma = boost::spirit::karma; namespace adaptors = boost::adaptors; int ints[] = {0, 1, 2, 3, 4}; std::cout << karma::format(karma::int_ % ' ' , ints | adaptors::transformed(&identity)); }