--- a/src/main.h Wed May 25 13:49:45 2022 +0300 +++ b/src/main.h Wed May 25 17:24:51 2022 +0300 @@ -302,3 +302,14 @@ }); return stream; } + +template<std::size_t N, typename T> +std::array<T, N> vectorToArray(const std::vector<T>& x) +{ + std::array<T, N> result; + for (std::size_t i = 0; i < x.size() and i < N; i += 1) + { + result[i] = x[i]; + } + return result; +}