summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/collections.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/collections.hpp b/lib/collections.hpp
new file mode 100644
index 0000000..ad4d947
--- /dev/null
+++ b/lib/collections.hpp
@@ -0,0 +1,14 @@
+#pragma once
+
+#include <array>
+
+template<typename T, std::size_t first, std::size_t second>
+std::array<T, first + second>
+operator+(const std::array<T, first> & a, const std::array<T, second> & b)
+{
+ std::array<T, first + second> r;
+ auto out = r.begin();
+ out = std::copy(a.begin(), a.end(), out);
+ std::copy(b.begin(), b.end(), out);
+ return r;
+}