summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/collections.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/collections.hpp b/lib/collections.hpp
index b87cda3..5d39e79 100644
--- a/lib/collections.hpp
+++ b/lib/collections.hpp
@@ -3,6 +3,16 @@
#include <array>
#include <span>
+template<typename T, typename E>
+concept SequentialCollection = requires(T c) {
+ {
+ c.size()
+ } -> std::integral;
+ {
+ c.data()
+ } -> std::same_as<const E *>;
+ };
+
template<typename T, std::size_t first, std::size_t second>
constexpr std::array<T, first + second>
operator+(const std::array<T, first> & a, const std::array<T, second> & b)