Re: Extracting parsed value from a local variable
Jens Kallup <[email protected]>
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
Hello Michele, try to use qi::_1 ... qi::_9 where _1 till _9 are placeholders for your input like double. The placeholder _1 is the first match, _2 the second, and so on... Jens On 10/23/2016 06:59 PM, Michele De Stefano wrote: > Dear all, > > here is my issue. I am creating a rule that happens to parse (amongst > several things) a double value into the qi::_a local variable. Now, > while staying into the same semantic action, I need to use that parsed > double value into another C++ instruction that requires a double value > as input. > > Think to this instruction as a generic > > ouput_type f(double x) > > The issue is that when I call (within the semantic action) > > f(qi::_a) > > the compiler complains that it cannot convert qi::_a into a double. > > Is there a way to extract the double value from qi::_a (or anyway from > any placeholder)? > > Thanks in advance. > > Best regards, > Michele > > -- > Michele De Stefano > Linked In <http://it.linkedin.com/in/micheledestefano> > mds-utils: a general purpose Open Source library > <http://sourceforge.net/projects/mds-utils/> > Personal Web Site <https://sites.google.com/site/micdestefano/> > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > > > _______________________________________________ > Spirit-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/spirit-general ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot