C++ - Design pattern - Memento
The Memento design pattern allows an object to retrieve last states of another object. This is used for example in the undo mechanism. So it’s a very interesting pattern that doesn’t use any interface. But instead it uses an opaque pointer in order to store old states of the main object. Let’s see that in this Memento design pattern tutorial. First of all GitHub: https://github.com/badprog/badprog-design-pattern-memento This pattern may seem obscur at first glance and maybe you have some questions such as: Why do we have to use three classes to save states of an object? ...