Replace Singleton<T>::get() with Singleton<T>::try_get and make it obsolete
[folly.git] / folly / futures / SharedPromise.h
index 0c8fcd9a747d86e59f132d1c9f2b72824b30b1f5..dc37e004854110344bb7105c0ed18a88b2992b80 100644 (file)
@@ -17,6 +17,7 @@
 #pragma once
 
 #include <folly/futures/Promise.h>
+#include <folly/Portability.h>
 
 namespace folly {
 
@@ -64,7 +65,8 @@ public:
       p.setException(std::current_exception());
     }
     */
-  void setException(std::exception_ptr const&) DEPRECATED;
+  FOLLY_DEPRECATED("use setException(exception_wrapper)")
+  void setException(std::exception_ptr const&);
 
   /** Fulfill the SharedPromise with an exception type E, which can be passed to
     std::make_exception_ptr(). Useful for originating exceptions. If you
@@ -81,13 +83,6 @@ 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() {
-    setTry(Try<T>());
-  }
-
   /// Sugar to fulfill this SharedPromise<Unit>
   template <class B = T>
   typename std::enable_if<std::is_same<Unit, B>::value, void>::type