Boost logo

Boost Users :

Subject: [Boost-users] calc2_ast.cpp
From: Olivier Austina (olivier.austina_at_[hidden])
Date: 2013-10-02 13:13:05

this is a basic question (I am sorry).
I am try to undestand the calc2_ast.cpp example at
I think the instruction expression_ast() : expr(nil()){} is an inheritance.
Where can I find the definition of expr()?
This is the code
 struct expression_ast
                nil // can't happen!
              , unsigned int
              , boost::recursive_wrapper<expression_ast>
              , boost::recursive_wrapper<binary_op>
              , boost::recursive_wrapper<unary_op>

       * expression_ast() : expr(nil()){};*

        template <typename Expr>
        expression_ast(Expr const& expr)
          : expr(expr) {}

        expression_ast& operator+=(expression_ast const& rhs);
        expression_ast& operator-=(expression_ast const& rhs);
        expression_ast& operator*=(expression_ast const& rhs);
        expression_ast& operator/=(expression_ast const& rhs);

        type expr;

    //expression_ast bbb;
    struct binary_op
            char op
          , expression_ast const& left
          , expression_ast const& right)
        : op(op), left(left), right(right) {}

        char op;
        expression_ast left;
        expression_ast right;

Thank you.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at