Skip to content

Instantly share code, notes, and snippets.

@KPCCoiL
Created June 29, 2014 05:20
Show Gist options
  • Save KPCCoiL/63b4e484d05fb5f082c2 to your computer and use it in GitHub Desktop.
Save KPCCoiL/63b4e484d05fb5f082c2 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
#include <boost/spirit/include/qi.hpp>
using namespace boost::spirit;
int main(){
std::string input = "123, 456.789";
int n1;
double n2;
auto first = input.begin(),last = input.end();
bool success = qi::parse(first,last,
qi::int_ >> ", " >> qi::double_,
n1,n2);
std::cout << n1 << ' ' << n2 << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment