Do not construct a Future<T> from a Future<Something> value
[folly.git] / folly / futures / Future.h
index cc0bd36ae2d3aa9ad4028bde7f1635d2153aaff9..06572c6306fc4818bfbfd5ff5966af8d5667b2c2 100644 (file)
@@ -56,7 +56,9 @@ class Future {
 
   /// Construct a Future from a value (perfect forwarding)
   /* implicit */
-  template <class T2 = T> Future(T2&& val);
+  template <class T2 = T,
+            typename std::enable_if<!isFuture<T2>::value, void*>::type = nullptr>
+  Future(T2&& val);
 
   template <class T2 = T,
             typename std::enable_if<