Fix an ICE in MSVC from functional/Invoke.h
[folly.git] / folly / functional / Invoke.h
index 2eab3ff6ba76c81e2103ed2cfe03980bce7c6c89..6dce01c0687a2a4a51044a2c7031521a613ebf7b 100644 (file)
@@ -86,9 +86,10 @@ using invoke_result_ =
     decltype(invoke(std::declval<F>(), std::declval<Args>()...));
 
 template <typename F, typename... Args>
-using invoke_nothrow_ = std::integral_constant<
-    bool,
-    noexcept(invoke(std::declval<F>(), std::declval<Args>()...))>;
+struct invoke_nothrow_
+    : std::integral_constant<
+          bool,
+          noexcept(invoke(std::declval<F>(), std::declval<Args>()...))> {};
 
 //  from: http://en.cppreference.com/w/cpp/types/result_of, CC-BY-SA
 
@@ -227,9 +228,10 @@ struct is_nothrow_invocable_r
     using result_ =                                                           \
         decltype(::std::declval<F>().membername(::std::declval<Args>()...));  \
     template <typename F, typename... Args>                                   \
-    using nothrow_ = ::std::integral_constant<                                \
-        bool,                                                                 \
-        noexcept(::std::declval<F>().membername(::std::declval<Args>()...))>; \
+    struct nothrow_ : std::integral_constant<                                 \
+                          bool,                                               \
+                          noexcept(::std::declval<F>().membername(            \
+                              ::std::declval<Args>()...))> {};                \
                                                                               \
     template <typename, typename F, typename... Args>                         \
     struct invoke_result_ {};                                                 \