]> git.stg.codes - stg.git/commitdiff
Added ability to optionally transfer resetable value to a real var.
authorMaxim Mamontov <faust.madf@gmail.com>
Wed, 9 Dec 2015 20:19:52 +0000 (22:19 +0200)
committerMaxim Mamontov <faust.madf@gmail.com>
Wed, 9 Dec 2015 20:31:25 +0000 (22:31 +0200)
include/stg/resetable.h

index 8a6ad27c13584e04ca05c98caae867e97d18699a..a451b357326cd946c72b77ddf7b4bd57c65b1a36 100644 (file)
@@ -50,6 +50,11 @@ public:
             is_set = true;
         }
     }
+    void maybeSet(value_type& dest) const
+    {
+        if (is_set)
+            dest = value;
+    }
 
 private:
     value_type value;