Transforming a Boost C++ Phoenix Expression Tree
问题 In the Boost Phoenix article, "Transforming the Expression Tree", here, a set of specialisations of a custom invert_actions class, are used to invert binary arithmetic expressions. For example a+b becomes a-b ; a*b becomes a/b ; and vice versa for both. This involves a recursive traversal of the expression tree - however, this traversal stops when an expression involving an operator not explicitly handled is encountered. For example, _1+_2-_3 will become _1-_2+_3 , but _1+_1&_2 will stay as