From: Christopher Dykes Date: Wed, 3 May 2017 14:11:09 +0000 (-0700) Subject: Fix ExceptionWrapper under MSVC 2015 Update 3 X-Git-Tag: v2017.05.08.00~21 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=59c1b560c01761fe3993d2a376a529f2a55edff7;p=folly.git 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(std::conjunction<>())` just do `std::conjunction<>::value`. Reviewed By: yfeldblum Differential Revision: D4988341 fbshipit-source-id: ededdbf3f3d945d9e2f140f4e87643ec3c0d4239 --- diff --git a/folly/ExceptionWrapper-inl.h b/folly/ExceptionWrapper-inl.h index d0062bca..d5ad7009 100644 --- a/folly/ExceptionWrapper-inl.h +++ b/folly/ExceptionWrapper-inl.h @@ -293,7 +293,7 @@ template < FOLLY_REQUIRES_DEF( Conjunction< exception_wrapper::IsStdException, - exception_wrapper::IsRegularExceptionType>())> + exception_wrapper::IsRegularExceptionType>::value)> inline exception_wrapper::exception_wrapper(Ex&& ex) : exception_wrapper{std::forward(ex), PlacementOf{}} { // Don't slice!!! @@ -306,7 +306,7 @@ template < class Ex, class Ex_, FOLLY_REQUIRES_DEF( - exception_wrapper::IsRegularExceptionType())> + exception_wrapper::IsRegularExceptionType::value)> inline exception_wrapper::exception_wrapper(in_place_t, Ex&& ex) : exception_wrapper{std::forward(ex), PlacementOf{}} { // Don't slice!!! diff --git a/folly/ExceptionWrapper.h b/folly/ExceptionWrapper.h index c305e688..a1adfecd 100644 --- a/folly/ExceptionWrapper.h +++ b/folly/ExceptionWrapper.h @@ -414,7 +414,7 @@ class exception_wrapper final { class Ex, class Ex_ = _t>, FOLLY_REQUIRES( - Conjunction, IsRegularExceptionType>())> + Conjunction, IsRegularExceptionType>::value)> /* implicit */ exception_wrapper(Ex&& ex); //! \pre `typeid(ex) == typeid(typename decay::type)` @@ -427,7 +427,7 @@ class exception_wrapper final { template < class Ex, class Ex_ = _t>, - FOLLY_REQUIRES(IsRegularExceptionType())> + FOLLY_REQUIRES(IsRegularExceptionType::value)> exception_wrapper(in_place_t, Ex&& ex); //! Swaps the value of `*this` with the value of `that`