/** * testmemento.cpp */ #include "memento.h" void main() { Originator originator; Caretaker caretaker; Memento* memento = originator.createMemento(); caretaker.push_back( memento ); /** * We can also pop the first memento * from the double-ended queue. */ originator.setMemento( caretaker.front() ); caretaker.pop_front(); }