An intro to the upgrade mutex in the Synchronized docs
[folly.git] / folly / Optional.h
index 6fc07b98f47e204f2f5501cca717087b7c5608a1..2b12ccc6a310d5a708cf945403bc0d91a2245c01 100644 (file)
@@ -54,6 +54,7 @@
  *  }
  */
 #include <cstddef>
+#include <new>
 #include <stdexcept>
 #include <type_traits>
 #include <utility>
@@ -205,6 +206,9 @@ class Optional {
     return storage_.value;
   }
 
+  // TODO: This should return Value&& instead of Value. Like with
+  // std::move, the calling code should decide whether it wants the move
+  // to happen or not. See std::optional.
   Value value() && {
     require_value();
     return std::move(storage_.value);
@@ -226,6 +230,9 @@ class Optional {
 
   const Value& operator*() const&  { return value(); }
         Value& operator*()      &  { return value(); }
+        // TODO: This should return Value&& instead of Value. Like with
+        // std::move, the calling code should decide whether it wants the move
+        // to happen or not. See std::optional.
         Value  operator*()      && { return std::move(value()); }
 
   const Value* operator->() const { return &value(); }