From ec34d6575fa03f1e137739ee1946f0ba9d3f2830 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 23 Sep 2017 19:21:45 +0200 Subject: compat: use c++17-style value templates --- compat/functional.hpp | 4 +++- compat/powerset.hpp | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'compat') 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 #include #include @@ -70,7 +72,7 @@ auto remove_if_not(F&& fun, const seq_& seq) using seq_type = std::decay_t; using value_type = std::decay_t::value_type>; using fun_ret_type = decltype(fun(std::declval())); - static_assert(std::is_convertible::value, "must return bool"); + static_assert(is_convertible_v, "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 #include #include @@ -12,13 +14,13 @@ template struct powerset final { - static_assert(std::is_integral::value, ""); + static_assert(is_integral_v, ""); using size_type = size_type_; static_assert(M > 0, ""); static_assert(M < sizeof(size_type[8]), ""); - static_assert(std::is_unsigned::value || M < sizeof(size_type)*8 - 1, ""); + static_assert((is_unsigned_v) || M < sizeof(size_type)*8 - 1, ""); using N = std::integral_constant; static_assert((N::value & (N::value + 1)) == 0, ""); -- cgit v1.2.3