Commit 5ef66c9e authored by Orvid King's avatar Orvid King Committed by Facebook Github Bot

Back out "[Folly] [MSVC] Workaround MSVC 15.7 bug"

Summary: Visual Studio 2017 Update 7.2 is out, so this is no longer needed. This should fix GCC 4.9 as well :)

Reviewed By: yfeldblum

Differential Revision: D8104179

fbshipit-source-id: e3b01c2f7f0fe69dc7286d2cfaa5c2c99d821b23
parent 660c0417
......@@ -151,11 +151,11 @@ FutureBase<T>::FutureBase(
: core_(CoreType::make(Try<T>(T()))) {}
template <class T>
template <class... Args>
FutureBase<T>::FutureBase(
typename std::
enable_if<std::is_constructible<T, Args&&...>::value, in_place_t>::type,
Args&&... args)
template <
class... Args,
typename std::enable_if<std::is_constructible<T, Args&&...>::value, int>::
type>
FutureBase<T>::FutureBase(in_place_t, Args&&... args)
: core_(CoreType::make(in_place, std::forward<Args>(args)...)) {}
template <class T>
......@@ -862,34 +862,35 @@ Future<T>& Future<T>::operator=(Future<T>&& other) noexcept {
}
template <class T>
template <class T2>
Future<T>::Future(
Future<T2>&& other,
template <
class T2,
typename std::enable_if<
!std::is_same<T, typename std::decay<T2>::type>::value &&
std::is_constructible<T, T2&&>::value &&
std::is_convertible<T2&&, T>::value,
int>::type)
int>::type>
Future<T>::Future(Future<T2>&& other)
: Future(std::move(other).then([](T2&& v) { return T(std::move(v)); })) {}
template <class T>
template <class T2>
Future<T>::Future(
Future<T2>&& other,
template <
class T2,
typename std::enable_if<
!std::is_same<T, typename std::decay<T2>::type>::value &&
std::is_constructible<T, T2&&>::value &&
!std::is_convertible<T2&&, T>::value,
int>::type)
int>::type>
Future<T>::Future(Future<T2>&& other)
: Future(std::move(other).then([](T2&& v) { return T(std::move(v)); })) {}
template <class T>
template <class T2>
typename std::enable_if<
!std::is_same<T, typename std::decay<T2>::type>::value &&
std::is_constructible<T, T2&&>::value,
Future<T>&>::type
Future<T>::operator=(Future<T2>&& other) {
template <
class T2,
typename std::enable_if<
!std::is_same<T, typename std::decay<T2>::type>::value &&
std::is_constructible<T, T2&&>::value,
int>::type>
Future<T>& Future<T>::operator=(Future<T2>&& other) {
return operator=(
std::move(other).then([](T2&& v) { return T(std::move(v)); }));
}
......
......@@ -115,12 +115,11 @@ class FutureBase {
/* implicit */ FutureBase(
typename std::enable_if<std::is_same<Unit, T2>::value>::type*);
template <class... Args>
explicit FutureBase(
typename std::enable_if<
std::is_constructible<T, Args&&...>::value,
in_place_t>::type,
Args&&... args);
template <
class... Args,
typename std::enable_if<std::is_constructible<T, Args&&...>::value, int>::
type = 0>
explicit FutureBase(in_place_t, Args&&... args);
FutureBase(FutureBase<T> const&) = delete;
FutureBase(SemiFuture<T>&&) noexcept;
......@@ -564,28 +563,29 @@ class Future : private futures::detail::FutureBase<T> {
Future(Future<T>&&) noexcept;
// converting move
template <class T2>
/* implicit */ Future(
Future<T2>&&,
template <
class T2,
typename std::enable_if<
!std::is_same<T, typename std::decay<T2>::type>::value &&
std::is_constructible<T, T2&&>::value &&
std::is_convertible<T2&&, T>::value,
int>::type = 0);
template <class T2>
explicit Future(
Future<T2>&&,
int>::type = 0>
/* implicit */ Future(Future<T2>&&);
template <
class T2,
typename std::enable_if<
!std::is_same<T, typename std::decay<T2>::type>::value &&
std::is_constructible<T, T2&&>::value &&
!std::is_convertible<T2&&, T>::value,
int>::type = 0);
template <class T2>
typename std::enable_if<
!std::is_same<T, typename std::decay<T2>::type>::value &&
std::is_constructible<T, T2&&>::value,
Future<T>&>::type
operator=(Future<T2>&&);
int>::type = 0>
explicit Future(Future<T2>&&);
template <
class T2,
typename std::enable_if<
!std::is_same<T, typename std::decay<T2>::type>::value &&
std::is_constructible<T, T2&&>::value,
int>::type = 0>
Future& operator=(Future<T2>&&);
using Base::cancel;
using Base::hasException;
......
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