diff options
Diffstat (limited to 'compat')
-rw-r--r-- | compat/functional.hpp | 4 | ||||
-rw-r--r-- | compat/powerset.hpp | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/compat/functional.hpp b/compat/functional.hpp index f7cd95c7..dcba0538 100644 --- a/compat/functional.hpp +++ b/compat/functional.hpp @@ -1,5 +1,7 @@ #pragma once +#include "value-templates.hpp" + #include <algorithm> #include <iterator> #include <type_traits> @@ -70,7 +72,7 @@ auto remove_if_not(F&& fun, const seq_& seq) using seq_type = std::decay_t<seq_>; using value_type = std::decay_t<typename std::iterator_traits<decltype(std::begin(seq))>::value_type>; using fun_ret_type = decltype(fun(std::declval<value_type>())); - static_assert(std::is_convertible<fun_ret_type, bool>::value, "must return bool"); + static_assert(is_convertible_v<fun_ret_type, bool>, "must return bool"); seq_type ret; maybe_reserve_space(ret, seq.size()); diff --git a/compat/powerset.hpp b/compat/powerset.hpp index ad7b07b0..fa49307e 100644 --- a/compat/powerset.hpp +++ b/compat/powerset.hpp @@ -1,5 +1,7 @@ #pragma once +#include "util.hpp" + #include <type_traits> #include <cinttypes> #include <vector> @@ -12,13 +14,13 @@ template<typename t, int M, typename size_type_ = std::uintptr_t> struct powerset final { - static_assert(std::is_integral<size_type_>::value, ""); + static_assert(is_integral_v<size_type_>, ""); using size_type = size_type_; static_assert(M > 0, ""); static_assert(M < sizeof(size_type[8]), ""); - static_assert(std::is_unsigned<size_type>::value || M < sizeof(size_type)*8 - 1, ""); + static_assert((is_unsigned_v<size_type>) || M < sizeof(size_type)*8 - 1, ""); using N = std::integral_constant<size_type, (size_type(1) << size_type(M))-1>; static_assert((N::value & (N::value + 1)) == 0, ""); |