+ return NULL;
+ }
+}
+
+/**
+* To be used with RedoKeepCurrent
+* Will always maintain the current state in the undo stack as the first element
+* Useful when states are saved after actions and the initial state is saved.
+*/
+template <class T>
+T* HistoryHandler<T>::UndoKeepCurrent()
+{
+ if(undoStack.size() > 1)
+ {
+ auto lastElem = undoStack.back();
+ undoStack.pop_back();
+ redoStack.push_back(lastElem);
+ return undoStack.back();
+ }else{
+ return NULL;
+ }
+}
+
+/**
+* To be used with UndoKeepCurrent
+* Will always maintain the current state in the undo stack as the first element
+* Useful when states are saved after actions and the initial state is saved.
+*/
+template <class T>
+T* HistoryHandler<T>::RedoKeepCurrent()
+{
+ if(!redoStack.empty())
+ {
+ auto lastElem = redoStack.back();
+ redoStack.pop_back();
+ undoStack.push_back(lastElem);
+ return undoStack.back();
+ }else{
+ return NULL;