Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

set `util::conjunction<>::value == false`

this patch changes `conjunction` to evaluate to false if given
template parameter pack is empty
  • Loading branch information...
commit 537a75c2422e53c3ac068acf1317341e415895d3 1 parent 8d61550
@Neverlord Neverlord authored
Showing with 10 additions and 5 deletions.
  1. +10 −5 cppa/util/conjunction.hpp
View
15 cppa/util/conjunction.hpp
@@ -38,13 +38,18 @@ namespace cppa { namespace util {
template<typename... BooleanConstants>
struct conjunction;
-template<typename T0, typename... Ts>
-struct conjunction<T0, Ts...>
- : std::integral_constant<bool, T0::value && conjunction<Ts...>::value> {
+template<>
+struct conjunction<> : std::false_type { };
+
+template<typename T0>
+struct conjunction<T0> {
+ static constexpr bool value = T0::value;
};
-template<>
-struct conjunction<> : std::true_type { };
+template<typename T0, typename T1, typename... Ts>
+struct conjunction<T0,T1,Ts...> {
+ static constexpr bool value = T0::value && conjunction<T1,Ts...>::value;
+};
} } // namespace cppa::util
Please sign in to comment.
Something went wrong with that request. Please try again.