diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-12-18 12:41:18 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-12-18 12:41:18 +0000 |
commit | 7f42cc44697654f7509ed21afe8966ca81c17edb (patch) | |
tree | 134c06ec17cd317541e5851da93edcfc685efd7a /lib/collections.hpp | |
parent | Manual Camera Controller should not refer to current properties (diff) | |
download | ilt-7f42cc44697654f7509ed21afe8966ca81c17edb.tar.bz2 ilt-7f42cc44697654f7509ed21afe8966ca81c17edb.tar.xz ilt-7f42cc44697654f7509ed21afe8966ca81c17edb.zip |
Helper operator+ to join arrays
Diffstat (limited to 'lib/collections.hpp')
-rw-r--r-- | lib/collections.hpp | 14 |
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; +} |