Augmenting functionality of subclasses without code duplication in C++
- by Rob W
I have to add common functionality to some classes that share the same superclass, preferably without bloating the superclass. The simplified inheritance chain looks like this:
Element -> HTMLElement -> HTMLAnchorElement
Element -> SVGElement -> SVGAlement
The default doSomething() method on Element is no-op by default, but there are…