diff --git a/include/sqlpp11/detail/logic.h b/include/sqlpp11/detail/logic.h index 57e335c9..abf30ce2 100644 --- a/include/sqlpp11/detail/logic.h +++ b/include/sqlpp11/detail/logic.h @@ -34,52 +34,16 @@ namespace sqlpp namespace detail { template - struct all_impl; - - template<> - struct all_impl<> - { - using type = std::true_type; - }; - - template - struct all_impl - { - using type = typename all_impl::type; - }; - - template - struct all_impl - { - using type = std::false_type; - }; + struct all_helper; template class Predicate, typename... T> - using all_t = typename all_impl::value...>::type; - - template - struct any_impl; - - template<> - struct any_impl<> - { - using type = std::false_type; - }; - - template - struct any_impl - { - using type = typename any_impl::type; - }; - - template - struct any_impl - { - using type = std::true_type; - }; + using all_t = std::is_same::value...>, all_helper<(true or Predicate::value)...>>; template class Predicate, typename... T> - using any_t = typename any_impl::value...>::type; + using any_t = typename std::conditional::value...>, all_helper<(false and Predicate::value)...>>::value, + std::false_type, + std::true_type + >::type; template struct not_impl;