Last active
January 2, 2018 23:58
-
-
Save joboccara/48afd888f2f3cb3e45953ee6a7809861 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 namespace boost::spirit::karma; | |
std::complex<double> c(3, -1); | |
std::string result; | |
generate( | |
std::back_inserter(result), // the output | |
!double_(0.0) << '(' << double_ << ',' << double_ << ')' // | |
| // the generator | |
omit[double_] << double_, // | |
c.imag(), c.real(), c.imag() // 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