I just watched a talk on #CPP and and it's polymorphic types. It's interesting to see how object oriented has caused so many issues and the resort is to go with a functional approach. Specially about that undo demo. They went with a persistent immutable datastructure at the end.
https://channel9.msdn.com/Events/GoingNative/2013/Inheritance-Is-The-Base-Class-of-Evil