#pragma once

#include <cstddef>

namespace psemek::math
{

	template <template <typename, std::size_t> typename V, typename T, std::size_t ... Ns>
	auto concat(V<T, Ns> const & ... vs)
	{
		V<T, (Ns + ...)> result;

		std::size_t i = 0;

		auto apply = [&]<std::size_t N>(V<T, N> const & v)
		{
			for (std::size_t j = 0; j < N;)
				result[i++] = v[j++];
		};

		(apply(vs), ...);

		return result;
	}

}
