Commit 8521e599 authored by Orvid King's avatar Orvid King Committed by Facebook Github Bot

Workaround MSVC 15.7 bug

Summary:
MSVC 15.7 (VS 2017 Update 7) was released a couple days ago, and includes a bug that's breaking Folly. Temporarily work around it.
A point release should be out soon(ish) to resolve the issue: https://developercommunity.visualstudio.com/content/problem/246602/157-fails-with-folly.html
There is still another issue in 15.7 that needs to be worked around, which will happen in a separate diff.

Reviewed By: yfeldblum

Differential Revision: D7937972

fbshipit-source-id: 4a2bc4ae0ea7165c45d100ad0a29409b60a0287a
parent 56a0d739
......@@ -151,11 +151,11 @@ FutureBase<T>::FutureBase(
: core_(CoreType::make(Try<T>(T()))) {}
template <class T>
template <
class... Args,
typename std::enable_if<std::is_constructible<T, Args&&...>::value, int>::
type>
FutureBase<T>::FutureBase(in_place_t, Args&&... args)
template <class... Args>
FutureBase<T>::FutureBase(
typename std::
enable_if<std::is_constructible<T, Args&&...>::value, in_place_t>::type,
Args&&... args)
: core_(CoreType::make(in_place, std::forward<Args>(args)...)) {}
template <class T>
......@@ -836,35 +836,34 @@ Future<T>& Future<T>::operator=(Future<T>&& other) noexcept {
}
template <class T>
template <
class T2,
template <class T2>
Future<T>::Future(
Future<T2>&& other,
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>
Future<T>::Future(Future<T2>&& other)
int>::type)
: Future(std::move(other).then([](T2&& v) { return T(std::move(v)); })) {}
template <class T>
template <
class T2,
template <class T2>
Future<T>::Future(
Future<T2>&& other,
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>
Future<T>::Future(Future<T2>&& other)
int>::type)
: 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,
int>::type>
Future<T>& 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,
Future<T>&>::type
Future<T>::operator=(Future<T2>&& other) {
return operator=(
std::move(other).then([](T2&& v) { return T(std::move(v)); }));
}
......
......@@ -73,11 +73,12 @@ class FutureBase {
/* implicit */ FutureBase(
typename std::enable_if<std::is_same<Unit, T2>::value>::type*);
template <
class... Args,
typename std::enable_if<std::is_constructible<T, Args&&...>::value, int>::
type = 0>
explicit FutureBase(in_place_t, Args&&... args);
template <class... Args>
explicit FutureBase(
typename std::enable_if<
std::is_constructible<T, Args&&...>::value,
in_place_t>::type,
Args&&... args);
FutureBase(FutureBase<T> const&) = delete;
FutureBase(SemiFuture<T>&&) noexcept;
......@@ -497,29 +498,28 @@ class Future : private futures::detail::FutureBase<T> {
Future(Future<T>&&) noexcept;
// converting move
template <
class T2,
template <class T2>
/* implicit */ Future(
Future<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>
/* implicit */ Future(Future<T2>&&);
template <
class T2,
int>::type = 0);
template <class T2>
explicit Future(
Future<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>
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>&&);
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>&&);
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