Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12094: Operator > changes attribute type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-03-24 21:43:48
#12094: Operator > changes attribute type
-----------------------------------+----------------------
Reporter: mikhail.strelnikov@⦠| Owner: djowel
Type: Bugs | Status: reopened
Milestone: To Be Determined | Component: spirit
Version: Boost 1.61.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------+----------------------
Comment (by djowel):
Replying to [comment:8 mikhail.strelnikov@â¦]:
> About "don't fight":
> {{{
> std::string input = "\\n\\t\\u1234";
> ...
> parse(b, e, *('\\' > (escape_seq | unicode)), ...);
> }}}
> What type of attribute it should return? It can be
std::vector<boost::variant<esc_ast, unicode_ast>> (where esc_ast and
unicode_ast are inheriting from x3::position_tagged because you need this)
or in can be simple std::string. I think you can't tell the attribute type
just by looking at the rule.
If esc_ast, unicode_ast can both be a string, then the natural attribute
would be vector<std::string>. An attribute of std::string is just pushing
it.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12094#comment:10> 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:19 UTC