Browse Source

AK: Add ScopedValueRollback::set_override_rollback_value().

This can be used if you change your mind about what value we should roll
back to. :^)
Andreas Kling 6 years ago
parent
commit
6ae95945aa
1 changed files with 5 additions and 0 deletions
  1. 5 0
      AK/ScopedValueRollback.h

+ 5 - 0
AK/ScopedValueRollback.h

@@ -16,6 +16,11 @@ public:
         m_variable = m_saved_value;
     }
 
+    void set_override_rollback_value(const T& value)
+    {
+        m_saved_value = value;
+    }
+
 private:
     T& m_variable;
     T m_saved_value;