Subject: [Boost-bugs] [Boost C++ Libraries] #8187: Bug in phoenix docs and example code
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-26 23:41:07
#8187: Bug in phoenix docs and example code
------------------------------+---------------------------------------------
Reporter: eric_niebler | Owner: theller
Type: Bugs | Status: new
Milestone: To Be Determined | Component: phoenix
Version: Boost 1.52.0 | Severity: Cosmetic
Keywords: |
------------------------------+---------------------------------------------
The example
[http://www.boost.org/libs/phoenix/doc/html/phoenix/examples/transforming_the_expression_tree.html
here] is leading people astray. It is not recursively applying the
transformation for node types other than plus, minus, multiplies and
divides. If the top-most node is not one of those, no transformation
happens.
The default case shown is:
{{{
struct invert_actions
{
template <typename Rule>
struct when
: proto::_ // the default is proto::_
{};
};
}}}
I think it should be:
{{{
struct invert_actions
{
template <typename Rule>
struct when
: proto::nary_expr<
proto::_,
proto::vararg<
proto::when<proto::_, evaluator(proto::_, _context)>
>
>
{};
};
}}}
I'm actually not quite sure how this works, but it seems to. Note that the
problem would also need to be fixed
[http://www.boost.org/libs/phoenix/example/invert.cpp here].
See [http://stackoverflow.com/questions/15077637/transforming-a-boost-c
-phoenix-expression-tree] for a discussion.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8187> 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:12 UTC