Skip to content

Instantly share code, notes, and snippets.

@joboccara
Created January 3, 2018 00:01
Show Gist options
  • Save joboccara/a6d3038d3c8c779262dc549555b7668e to your computer and use it in GitHub Desktop.
Save joboccara/a6d3038d3c8c779262dc549555b7668e to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
#include <boost/spirit/include/karma.hpp>
int main()
{
using boost::spirit::karma::int_;
using boost::spirit::karma::generate;
std::string result;
generate(
std::back_inserter(result), // the output
int_, // the generator
42 // the input
);
std::cout << result << "\n\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment