Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6043: Spirit insists that user types are adapted to Fusion
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-09 00:16:15
#6043: Spirit insists that user types are adapted to Fusion
-------------------------------+--------------------------------------------
Reporter: vladimir_prus | Owner: djowel
Type: Patches | Status: new
Milestone: To Be Determined | Component: spirit
Version: Boost 1.47.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------------------------
Comment (by anonymous):
Here's what's happening:
When you have A >> B, the rules are: http://tinyurl.com/bqch2m6
So, as far as compatibility goes, the attribute either has to be a fusion
sequence *or* a std container. That is why your code does not compile.
The thing is, spirit is optimal and walks the sequence and builds its
elements in-situ, instead of synthesising a temporary sequence in memory
and assign later. That is why it has to iterate over existing instances.
In this case, it cannot walk a foo. Heller's workaround works because the
inner rule is able to walk the fusion sequence and then attribute
transformation kicks in whereby it assigns the fusion sequence to foo.
That works but is sub optimal.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6043#comment:3> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC