jeudi 21 juillet 2016

boost spirit x3 int32 | double_ fails to parse double

I am trying to write a parser, which parses either a int32_t or a double. As a first try I wrote this parser:

const auto int_or_double = boost::spirit::x3::int32 | boost::spirit::x3::double_;

which I expect to get back a boost::variant<int32_t, double> the parser succeed to parse ints like 12, 100, -42, 7 but it fails to parse doubles like 13.243, 42.7, 12.0 -10000.3

here is a live demo

Why does this parser fail on doubles?

Aucun commentaire:

Enregistrer un commentaire