General C++ strategy for such structures
Class Expr contains (only) a pointer to the auxiliary class
The auxiliary class is an abstract base class for the hierarchy
The auxiliary class also contains a use count, which Expr manipulates
Previous slide
Next slide
Back to first slide
View graphic version