Re: semantic action problem
Klemens Morgenstern <[email protected]>
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
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