From a3596b582d300dad07fc1c536efa486a9cbd8b79 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 2 Jan 2023 15:04:50 +0000 Subject: Add a concept for sequential collections suitable for passing to OpenGL --- lib/collections.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/collections.hpp') 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 #include +template +concept SequentialCollection = requires(T c) { + { + c.size() + } -> std::integral; + { + c.data() + } -> std::same_as; + }; + template constexpr std::array operator+(const std::array & a, const std::array & b) -- cgit v1.2.3