]> git.stg.codes - stg.git/blobdiff - include/stg/resetable.h
Added Splice method for resetables.
[stg.git] / include / stg / resetable.h
index c78d02476e5cbea97d9b80acd764a80aad8d1c61..8a6ad27c13584e04ca05c98caae867e97d18699a 100644 (file)
@@ -42,6 +42,14 @@ public:
     const T & data() const throw() { return value; }
     bool empty() const throw() { return !is_set; }
     void reset() throw() { is_set = false; }
+    void splice(const RESETABLE<T> & rhs)
+    {
+        if (rhs.is_set)
+        {
+            value = rhs.value;
+            is_set = true;
+        }
+    }
 
 private:
     value_type value;