summaryrefslogtreecommitdiffhomepage
path: root/compat/powerset.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-09-23 19:21:45 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-09-23 19:21:45 +0200
commitec34d6575fa03f1e137739ee1946f0ba9d3f2830 (patch)
tree7aa2ba948a8c2656145aa60f992aad8d96f33534 /compat/powerset.hpp
parent40c45a336489103b1da50e07479dd2808ae304d6 (diff)
compat: use c++17-style value templates
Diffstat (limited to 'compat/powerset.hpp')
-rw-r--r--compat/powerset.hpp6
1 files changed, 4 insertions, 2 deletions
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, "");