Fix ExceptionWrapper under MSVC 2015 Update 3
authorChristopher Dykes <cdykes@fb.com>
Wed, 3 May 2017 14:11:09 +0000 (07:11 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 3 May 2017 14:21:51 +0000 (07:21 -0700)
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

folly/ExceptionWrapper-inl.h
folly/ExceptionWrapper.h

index d0062bcacd0c570a9622ef7007c6041e8950f404..d5ad7009d60ef7a7220122e42e36c458984b100a 100644 (file)
@@ -293,7 +293,7 @@ template <
     FOLLY_REQUIRES_DEF(
         Conjunction<
             exception_wrapper::IsStdException<Ex_>,
-            exception_wrapper::IsRegularExceptionType<Ex_>>())>
+            exception_wrapper::IsRegularExceptionType<Ex_>>::value)>
 inline exception_wrapper::exception_wrapper(Ex&& ex)
     : exception_wrapper{std::forward<Ex>(ex), PlacementOf<Ex_>{}} {
   // Don't slice!!!
@@ -306,7 +306,7 @@ template <
     class Ex,
     class Ex_,
     FOLLY_REQUIRES_DEF(
-        exception_wrapper::IsRegularExceptionType<Ex_>())>
+        exception_wrapper::IsRegularExceptionType<Ex_>::value)>
 inline exception_wrapper::exception_wrapper(in_place_t, Ex&& ex)
     : exception_wrapper{std::forward<Ex>(ex), PlacementOf<Ex_>{}} {
   // Don't slice!!!
index c305e688d79fa750b9e61bae02c0026750d2f07d..a1adfecdd3763110c8a9f0f0cab86bf9ee74027f 100644 (file)
@@ -414,7 +414,7 @@ class exception_wrapper final {
       class Ex,
       class Ex_ = _t<std::decay<Ex>>,
       FOLLY_REQUIRES(
-          Conjunction<IsStdException<Ex_>, IsRegularExceptionType<Ex_>>())>
+          Conjunction<IsStdException<Ex_>, IsRegularExceptionType<Ex_>>::value)>
   /* implicit */ exception_wrapper(Ex&& ex);
 
   //! \pre `typeid(ex) == typeid(typename decay<Ex>::type)`
@@ -427,7 +427,7 @@ class exception_wrapper final {
   template <
       class Ex,
       class Ex_ = _t<std::decay<Ex>>,
-      FOLLY_REQUIRES(IsRegularExceptionType<Ex_>())>
+      FOLLY_REQUIRES(IsRegularExceptionType<Ex_>::value)>
   exception_wrapper(in_place_t, Ex&& ex);
 
   //! Swaps the value of `*this` with the value of `that`