Make folly::StrictConjunction usable under MSVC
authorChristopher Dykes <cdykes@fb.com>
Wed, 12 Apr 2017 17:44:00 +0000 (10:44 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 12 Apr 2017 17:50:04 +0000 (10:50 -0700)
Summary:
Template pack expansion plays much nicer when being expanded into the template parameters of a base class than it does as the template parameters to a templated `using` when under MSVC.
This fixes the other half of `folly::exception_wrapper`.

Reviewed By: yfeldblum

Differential Revision: D4874047

fbshipit-source-id: 6593d10f8737b940bd550353e54f43bc96402a48

folly/Traits.h

index 4be2282c96c4b2f8f9c08a2c4c102dda9dc1280b..01222addfd0ff454fe49eecf3ae2051d9b1274bd 100644 (file)
@@ -386,8 +386,8 @@ struct Bools {
 
 // Lighter-weight than Conjunction, but evaluates all sub-conditions eagerly.
 template <class... Ts>
-using StrictConjunction =
-    std::is_same<Bools<Ts::value..., true>, Bools<true, Ts::value...>>;
+struct StrictConjunction
+    : std::is_same<Bools<Ts::value..., true>, Bools<true, Ts::value...>> {};
 
 } // namespace folly