From d75e737de182d11d0293212d6fd0fc2c6732af54 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 17 Mar 2023 02:03:30 +0000 Subject: Allow overriding vectorOfN's returned type --- lib/collections.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/collections.hpp b/lib/collections.hpp index 16870be..2b83500 100644 --- a/lib/collections.hpp +++ b/lib/collections.hpp @@ -92,11 +92,11 @@ operator+(const std::vector & in, Vn && vn) return out; } -template typename Direction = std::plus> +template typename Direction = std::plus, typename T = unsigned int> [[nodiscard]] static auto -vectorOfN(std::integral auto N, unsigned int start = {}, unsigned int step = 1) +vectorOfN(std::integral auto N, T start = {}, T step = 1) { - std::vector v; + std::vector v; v.resize(N); std::generate_n(v.begin(), N, [&start, step, adj = Direction {}]() { return std::exchange(start, adj(start, step)); -- cgit v1.2.3