Commit 4b7d98cb authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot 3

Adjust the way Future<Unit>'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
parent 3c4a013f
......@@ -82,9 +82,9 @@ Future<T>::Future(T2&& val)
: core_(new detail::Core<T>(Try<T>(std::forward<T2>(val)))) {}
template <class T>
template <typename, typename>
Future<T>::Future()
: core_(new detail::Core<T>(Try<T>(T()))) {}
template <typename T2>
Future<T>::Future(typename std::enable_if<std::is_same<Unit, T2>::value>::type*)
: core_(new detail::Core<T>(Try<T>(T()))) {}
template <class T>
Future<T>::~Future() {
......
......@@ -71,10 +71,9 @@ class Future {
!isFuture<typename std::decay<T2>::type>::value>::type>
/* implicit */ Future(T2&& val);
template <class T2 = T, typename =
typename std::enable_if<
std::is_same<Unit, T2>::value>::type>
Future();
template <class T2 = T>
/* implicit */ Future(
typename std::enable_if<std::is_same<Unit, T2>::value>::type* = nullptr);
~Future();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment