Re: X3 boost::optional<std::string> problem.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: X3 boost::optional<std::string> problem.

tomkulaga
Hi All,

I have the following string parser:

const auto nonQuotedString = lexeme[*(char_ - lit(" ")) >> lit(" ")];

When I stick this into a rule_def such that this is optional,

-nonQuotedString and I have the corresponding boost::optional<std::string> in my struct. It doesn't and mentions that optional doesnt have insert method.

THOUGH if i change it to -char_ and change my struct accordingly, it compiles.

So by me having an optional std::string as part of my struct and parsing, it doesn't compile.

Would anyone have any ideas?


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: X3 boost::optional<std::string> problem.

tomkulaga
when i broke it up, into a quotedString_def ... quotedString_class and quotedString_type then used BOOST_SPIRIT_DEFINE the error went away.

I'll try and get a minimal compil-able example 

On Tue, 26 Jul 2016 at 00:34 Tom Kulaga <[hidden email]> wrote:
Hi All,

I have the following string parser:

const auto nonQuotedString = lexeme[*(char_ - lit(" ")) >> lit(" ")];

When I stick this into a rule_def such that this is optional,

-nonQuotedString and I have the corresponding boost::optional<std::string> in my struct. It doesn't and mentions that optional doesnt have insert method.

THOUGH if i change it to -char_ and change my struct accordingly, it compiles.

So by me having an optional std::string as part of my struct and parsing, it doesn't compile.

Would anyone have any ideas?


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general