Commit 59c1b560 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Fix ExceptionWrapper under MSVC 2015 Update 3

Summary: Besides this code being utterly bizzare, it doesn't work under MSVC 2015 Update 3, so rather than doing a `static_cast<bool>(std::conjunction<>())` just do `std::conjunction<>::value`.

Reviewed By: yfeldblum

Differential Revision: D4988341

fbshipit-source-id: ededdbf3f3d945d9e2f140f4e87643ec3c0d4239
parent 5e8852c8
...@@ -293,7 +293,7 @@ template < ...@@ -293,7 +293,7 @@ template <
FOLLY_REQUIRES_DEF( FOLLY_REQUIRES_DEF(
Conjunction< Conjunction<
exception_wrapper::IsStdException<Ex_>, exception_wrapper::IsStdException<Ex_>,
exception_wrapper::IsRegularExceptionType<Ex_>>())> exception_wrapper::IsRegularExceptionType<Ex_>>::value)>
inline exception_wrapper::exception_wrapper(Ex&& ex) inline exception_wrapper::exception_wrapper(Ex&& ex)
: exception_wrapper{std::forward<Ex>(ex), PlacementOf<Ex_>{}} { : exception_wrapper{std::forward<Ex>(ex), PlacementOf<Ex_>{}} {
// Don't slice!!! // Don't slice!!!
...@@ -306,7 +306,7 @@ template < ...@@ -306,7 +306,7 @@ template <
class Ex, class Ex,
class Ex_, class Ex_,
FOLLY_REQUIRES_DEF( FOLLY_REQUIRES_DEF(
exception_wrapper::IsRegularExceptionType<Ex_>())> exception_wrapper::IsRegularExceptionType<Ex_>::value)>
inline exception_wrapper::exception_wrapper(in_place_t, Ex&& ex) inline exception_wrapper::exception_wrapper(in_place_t, Ex&& ex)
: exception_wrapper{std::forward<Ex>(ex), PlacementOf<Ex_>{}} { : exception_wrapper{std::forward<Ex>(ex), PlacementOf<Ex_>{}} {
// Don't slice!!! // Don't slice!!!
......
...@@ -414,7 +414,7 @@ class exception_wrapper final { ...@@ -414,7 +414,7 @@ class exception_wrapper final {
class Ex, class Ex,
class Ex_ = _t<std::decay<Ex>>, class Ex_ = _t<std::decay<Ex>>,
FOLLY_REQUIRES( FOLLY_REQUIRES(
Conjunction<IsStdException<Ex_>, IsRegularExceptionType<Ex_>>())> Conjunction<IsStdException<Ex_>, IsRegularExceptionType<Ex_>>::value)>
/* implicit */ exception_wrapper(Ex&& ex); /* implicit */ exception_wrapper(Ex&& ex);
//! \pre `typeid(ex) == typeid(typename decay<Ex>::type)` //! \pre `typeid(ex) == typeid(typename decay<Ex>::type)`
...@@ -427,7 +427,7 @@ class exception_wrapper final { ...@@ -427,7 +427,7 @@ class exception_wrapper final {
template < template <
class Ex, class Ex,
class Ex_ = _t<std::decay<Ex>>, class Ex_ = _t<std::decay<Ex>>,
FOLLY_REQUIRES(IsRegularExceptionType<Ex_>())> FOLLY_REQUIRES(IsRegularExceptionType<Ex_>::value)>
exception_wrapper(in_place_t, Ex&& ex); exception_wrapper(in_place_t, Ex&& ex);
//! Swaps the value of `*this` with the value of `that` //! Swaps the value of `*this` with the value of `that`
......
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