Skip to content

Instantly share code, notes, and snippets.

@redboltz
Created June 1, 2015 02:25
Show Gist options
  • Save redboltz/5c89916d4c9d1992cc93 to your computer and use it in GitHub Desktop.
Save redboltz/5c89916d4c9d1992cc93 to your computer and use it in GitHub Desktop.
SpiritX3 example on C++Now2015 Pace41(in PDF)
#include <boost/config/warning_disable.hpp>
#include <boost/spirit/home/x3.hpp>
namespace x3 = boost::spirit::x3;
int main() {
using x3::char_;
std::string input( "cosmic pizza" );
auto iter = input.begin();
auto end_iter = input.end();
std::string result1;
std::string result2;
parse(iter, end_iter,
*(~char_(' ')) >> ' ' >> *char_,
result1,
result2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment