summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-01-15 12:01:33 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-01-15 12:01:33 +0100
commit9a231ffd8bd35108092d218c834544657bfb5986 (patch)
tree7e34f76e6eb4195cab263f042061800abb077482 /compat
parent6aae07688b650be756a443495fa760c2f0a5dc24 (diff)
c
Diffstat (limited to 'compat')
-rw-r--r--compat/enum-bitset-fwd.hpp9
-rw-r--r--compat/enum-bitset.hpp3
2 files changed, 11 insertions, 1 deletions
diff --git a/compat/enum-bitset-fwd.hpp b/compat/enum-bitset-fwd.hpp
new file mode 100644
index 00000000..ad75b3aa
--- /dev/null
+++ b/compat/enum-bitset-fwd.hpp
@@ -0,0 +1,9 @@
+#pragma once
+
+namespace floormat {
+
+template<typename Enum, Enum COUNT_ = Enum::COUNT>
+requires (std::is_enum_v<Enum> && std::is_same_v<size_t, std::common_type_t<size_t, std::underlying_type_t<Enum>>>)
+struct enum_bitset;
+
+} // namespace floormat
diff --git a/compat/enum-bitset.hpp b/compat/enum-bitset.hpp
index ebbd9982..f1c23808 100644
--- a/compat/enum-bitset.hpp
+++ b/compat/enum-bitset.hpp
@@ -1,9 +1,10 @@
#pragma once
+#include "enum-bitset-fwd.hpp"
#include <bitset>
namespace floormat {
-template<typename Enum, Enum COUNT_ = Enum::COUNT>
+template<typename Enum, Enum COUNT_>
requires (std::is_enum_v<Enum> && std::is_same_v<size_t, std::common_type_t<size_t, std::underlying_type_t<Enum>>>)
struct enum_bitset : std::bitset<size_t(COUNT_)> {
using enum_type = Enum;