The other two constructors are simple
Expr::Expr(const char* op,
const Expr& e):
p(new UnaryExpr(op, e)) { }
Expr::Expr(const char* op,
const Expr& e1, const Expr& e2):
p(new BinaryExpr(op, e1, e2)) { }
Previous slide
Next slide
Back to first slide
View graphic version