Nuke Future<void> (folly/futures)
[folly.git] / folly / futures / SharedPromise.h
index 5041a38ab724bab547fd13413fe481a0d0cd3ab8..1d5670cde2efa5f4bc27f4712de08bb159102edb 100644 (file)
@@ -45,8 +45,10 @@ public:
   SharedPromise(SharedPromise<T>&&) noexcept;
   SharedPromise& operator=(SharedPromise<T>&&) noexcept;
 
-  /** Return a Future tied to the shared core state. This can be called only
-    once, thereafter Future already retrieved exception will be raised. */
+  /**
+   * Return a Future tied to the shared core state. Unlike Promise::getFuture,
+   * this can be called an unlimited number of times per SharedPromise.
+   */
   Future<T> getFuture();
 
   /** Return the number of Futures associated with this SharedPromise */
@@ -79,18 +81,11 @@ public:
   /// handled.
   void setInterruptHandler(std::function<void(exception_wrapper const&)>);
 
-  /// Fulfill this SharedPromise<void>
-  template <class B = T>
-  typename std::enable_if<std::is_void<B>::value, void>::type
-  setValue() {
-    set(Try<T>());
-  }
-
   /// Sugar to fulfill this SharedPromise<Unit>
   template <class B = T>
   typename std::enable_if<std::is_same<Unit, B>::value, void>::type
   setValue() {
-    set(Try<T>(T()));
+    setTry(Try<T>(T()));
   }
 
   /** Set the value (use perfect forwarding for both move and copy) */