Created
June 29, 2014 05:20
-
-
Save KPCCoiL/63b4e484d05fb5f082c2 to your computer and use it in GitHub Desktop.
This file contains 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/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