From ba761a571ab9d62fa21e78d1b53f885f82b48446 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 24 Feb 2023 19:26:57 +0000 Subject: Fixed up vector operator+ element --- lib/collections.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/collections.hpp') diff --git a/lib/collections.hpp b/lib/collections.hpp index 47967b2..31e5ab8 100644 --- a/lib/collections.hpp +++ b/lib/collections.hpp @@ -82,13 +82,13 @@ operator+=(std::vector & in, std::vector && src) return in; } -template +template constexpr auto -operator+(std::vector && in, std::vector && src) +operator+(const std::vector & in, Vn && vn) { - in.reserve(in.size() + src.size()); - std::move(src.begin(), src.end(), std::back_inserter(in)); - return in; + auto out(in); + out.emplace_back(std::forward(vn)); + return out; } template typename Direction = std::plus> -- cgit v1.2.3