Created
January 2, 2018 23:59
-
-
Save joboccara/b4fb291e68b31d08122dde59417e6928 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <boost/spirit/include/karma.hpp> | |
int main() | |
{ | |
using boost::spirit::karma::int_; | |
using boost::spirit::karma::generate; | |
std::vector<int> numbers = {5, 3, 2}; | |
std::string result; | |
generate( | |
std::back_inserter(result), // the output | |
int_ << *(", " << int_), // the generator | |
numbers // 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