From: Christopher Dykes Date: Mon, 20 Jun 2016 18:29:55 +0000 (-0700) Subject: Adjust the way Future's constructor is defined X-Git-Tag: 2016.07.26~132 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=4b7d98cb635fe2666ef0ce0d809634080eb0dcf7;p=folly.git Adjust the way Future's constructor is defined Summary: This is needed to work around a limitation in MSVC's SFINAE support. Reviewed By: yfeldblum Differential Revision: D3271292 fbshipit-source-id: 88052beaa97a297c6eb3eb5047c8fed48c8155af --- diff --git a/folly/futures/Future-inl.h b/folly/futures/Future-inl.h index 094ccdc0..c068df06 100644 --- a/folly/futures/Future-inl.h +++ b/folly/futures/Future-inl.h @@ -82,9 +82,9 @@ Future::Future(T2&& val) : core_(new detail::Core(Try(std::forward(val)))) {} template -template -Future::Future() - : core_(new detail::Core(Try(T()))) {} +template +Future::Future(typename std::enable_if::value>::type*) + : core_(new detail::Core(Try(T()))) {} template Future::~Future() { diff --git a/folly/futures/Future.h b/folly/futures/Future.h index c3249fde..7563507d 100644 --- a/folly/futures/Future.h +++ b/folly/futures/Future.h @@ -71,10 +71,9 @@ class Future { !isFuture::type>::value>::type> /* implicit */ Future(T2&& val); - template ::value>::type> - Future(); + template + /* implicit */ Future( + typename std::enable_if::value>::type* = nullptr); ~Future();