From 7f42cc44697654f7509ed21afe8966ca81c17edb Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 18 Dec 2022 12:41:18 +0000 Subject: Helper operator+ to join arrays --- lib/collections.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/collections.hpp (limited to 'lib/collections.hpp') 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 + +template +std::array +operator+(const std::array & a, const std::array & b) +{ + std::array r; + auto out = r.begin(); + out = std::copy(a.begin(), a.end(), out); + std::copy(b.begin(), b.end(), out); + return r; +} -- cgit v1.2.3