Re: x3 static initialisation problems
Seth <[email protected]>
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
On 23-09-17 22:18, Dirk Bonekämper wrote: > So I checked the calc9 expression_def example file to see how the > examples handled the problem. I saw that the static object still > gets returned by reference. But now a static symbol parser is also > inititialized by the parser::myrule() function. Are you trying to say there's an issue in the sample code? I'm not sure that `myrule` is a part of the sample or you refer to your own code. > My solution: Return reference to rule from a Meyers singlenton. Yup. That's the industry standard approach to dealing with SIOF > Keep symbol initialization within the static section like in 1.60. I'm unsure what you mean. Did something break in X3 after 1.60? > Caveat: I still need to keep a namespace myrule object as the > BOOST_SPIRIT_DEFINE_ macro expects it. The macro only uses the name > in decltype(name), so maybe the macro could be changed to use > PP_CAT(rule_name, _type) to generate the type of the rule. Are you suggesting a change to the macros? Are you referring to your code? Hope you can clarify what made you post this, so the intended audience gets interested. Seth ------------------------------------------------------------------------------ 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