Skip to content

Instantly share code, notes, and snippets.

@redbaron
Created March 17, 2014 23:01
Show Gist options
  • Save redbaron/9610165 to your computer and use it in GitHub Desktop.
Save redbaron/9610165 to your computer and use it in GitHub Desktop.
#include <boost/spirit/home/x3.hpp>
#include <string>
int main() {
namespace x3 = boost::spirit::x3;
const std::string input = "A\nB\nC";
auto const p = *(x3::char_ >> x3::omit[x3::lit("\n")]);
std::string attr;
auto it = input.begin();
x3::parse(it, input.end(), p, attr);
assert(attr == "AB"); //it is ABC without patch
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment