X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/c8b080defffe28f5fc1aa39447a467d8f7b7ee5c..0d6d9ba8a9c8512a0e1fd66a398c61e656644516:/include/stg/resetable.h?ds=inline

diff --git a/include/stg/resetable.h b/include/stg/resetable.h
index c78d0247..e7914efd 100644
--- a/include/stg/resetable.h
+++ b/include/stg/resetable.h
@@ -16,19 +16,7 @@ public:
     typedef T value_type;
 
     RESETABLE() : value(), is_set(false) {}
-    RESETABLE(const T & v) : value(v), is_set(true) {}
-
-    RESETABLE(const RESETABLE<T> & rvalue)
-        : value(rvalue.value),
-          is_set(rvalue.is_set)
-    {}
-
-    RESETABLE<T> & operator=(const RESETABLE<T> & rhs)
-    {
-        value = rhs.value;
-        is_set = rhs.is_set;
-        return *this;
-    }
+    explicit RESETABLE(const T & v) : value(v), is_set(true) {}
 
     RESETABLE<T> & operator=(const T & rhs)
     {
@@ -42,6 +30,19 @@ 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;
+        }
+    }
+    void maybeSet(value_type& dest) const
+    {
+        if (is_set)
+            dest = value;
+    }
 
 private:
     value_type value;