#8187 closed Bugs (fixed)
Bug in phoenix docs and example code
| Reported by: | Eric Niebler | Owned by: | Kohei Takahashi |
|---|---|---|---|
| Milestone: | Boost 1.67.0 | Component: | phoenix |
| Version: | Boost 1.52.0 | Severity: | Cosmetic |
| Keywords: | Cc: |
Description
The example 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 here.
See http://stackoverflow.com/questions/15077637/transforming-a-boost-c-phoenix-expression-tree for a discussion.
Change History (3)
comment:1 by , 5 years ago
| Milestone: | To Be Determined → Boost 1.65.0 |
|---|---|
| Owner: | changed from to |
comment:2 by , 5 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:3 by , 5 years ago
| Milestone: | Boost 1.65.0 → Boost 1.67.0 |
|---|
Note:
See TracTickets
for help on using tickets.

Yes, you are right.