memento design pattern c++