Unify runInMainContext for void and non-void
[folly.git] / folly / futures / Try.h
index 437127b8c67802fd051e7db29fa64f609b128479..b4152dd46c2c796559f62d42c19e034d73c8feaf 100644 (file)
@@ -124,14 +124,21 @@ class Try {
    *
    * @returns mutable reference to the contained value
    */
-  T& value();
+  T& value()&;
+  /*
+   * Get a rvalue reference to the contained value. If the Try contains an
+   * exception it will be rethrown.
+   *
+   * @returns rvalue reference to the contained value
+   */
+  T&& value()&&;
   /*
    * Get a const reference to the contained value. If the Try contains an
    * exception it will be rethrown.
    *
    * @returns const reference to the contained value
    */
-  const T& value() const;
+  const T& value() const&;
 
   /*
    * If the Try contains an exception, rethrow it. Otherwise do nothing.