Re: Ambiguous call to overloaded function
Larry Evans <[email protected]>
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
On 12/01/2017 06:47 PM, Larry Evans wrote: > On 11/24/2017 01:01 PM, Michael Powell wrote: >> On Fri, Nov 24, 2017 at 1:03 PM, Michael Powell >> <[email protected]> wrote: >>> I'm not positive, this may be a similar situation as with: >>> >>> http://boost.2283326.n4.nabble.com/Spirit-X3-employee-cpp-compile-error-td4687704.html >>> >>> >>> Related to VS2015 Update 3 support. >>> >>> With solutions that seem to revolve around necessity of >>> BOOST_SPIRIT_DEFINE (?). >> >> And if I just take the error on its face, just what is the difference >> between Attribute& and ActualAttribute&, other than in name only? >> >>> Can someone clarify? >>> >>> Thank you. >>> >>> Cheers, >>> >>> Michael Powell >>> > Hi Michael, > > I think ( I'm not real sure) that Attribute is the Attribute as > declared in the rule, but the ActualAttribute is the actual type > of the attribute passed to the parse function. AFAICT, the > attribute transform done in the call_rule_definition here: > > https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/x3/nonterminal/detail/rule.hpp#L297 > > > converts the ActualAttribute to the Attribute required by the rule. > > HOWEVER, that conclusion is just based on my many hours examining the > code Actually, just looking at the rule<...>::parse function code: https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/x3/nonterminal/rule.hpp#L57 and then the function called from there: https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/x3/nonterminal/detail/rule.hpp#L297 confirms the conclusion that Attribute is the rule attribute whereas ActualAttribute is what is actually passed to the parse function for rule_definition. If you're wondering how might they become different, then you might have to look at how sequence attributes are handled. In particular, the parse_sequence function in: https://github.com/boostorg/spirit/blob/develop/include/boost/spirit/home/x3/operator/detail/sequence.hpp IIUC, for a sequence, the attribute is converted to a fusion iterator and then increments of that are passed to the various parts of the sequence, and I think the ActualAttribute might be one of these fusion iterators actually pointing to the rule attribute. At least that's my *partial* understanding of how the ActualAtrribute can be different than Attribute. HTH. -regards, Larry ------------------------------------------------------------------------------ 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