Re: semantic action problem
Tom Kulaga <[email protected]>
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <CAMWfBPHjd8_s5_bYdjD5jWnmbZb1fiZ29Nqa0xQAYZCMD90Pdw@mail.gmail.com> |
There are known problems with MSVC and sprirt X3 especially when it comes to the define macro. Someone has posted a modifies macro on these mailing lists to fix this particular issue. On 5 Dec. 2016 6:27 am, "Klemens Morgenstern" <[email protected]> wrote: > The good new is: the example is fine and works on gcc 6. The bad news > is, it doesn't on msvc, so this seems to be the problem here. I tried a > global declaration, i.e. this: > > auto f = [](auto& ctx) { std::cout << x3::_attr(ctx) << std::endl; }; > x3::rule<class test_rule> test_rule; > auto test_rule_def = '{' >> x3::int_[f] >> '}'; > BOOST_SPIRIT_DEFINE(test_rule); > > But that only changed the error type. So you could switch to mingw 6.2 > and would be able to use it, but maybe someone knows how to get it to > work on msvc. > > > > Am 04.12.2016 um 19:44 schrieb Eugene Varshavsky: > > Klemens, > > Thank you for the quick reply, > > > > Sorry for posting a screen shot in the first place... > > > > I am attaching the code this time. It is an exact copy from the Spirit > > tutorial at: > > http://ciere.com/cppnow15/x3_docs/spirit/tutorials/semantic_actions.html > > > > I am using: > > Visual Studio Community 2015 > > Version 14.0.24720.00 Update 1 > > > > File call.hpp appears to be part of boost.spirit, it is located at: > > C/.../Boost/boost_1_62_0/boost/spirit/home/x3/core > > > > Using x3::_attr in main for the lambda did not seem to help. > > > > Thank you, > > Eugene > > > ------------------------------------------------------------ > ------------------ > 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 _______________________________________________ Spirit-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/spirit-general