diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-02-24 19:26:57 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-02-24 19:26:57 +0000 |
commit | ba761a571ab9d62fa21e78d1b53f885f82b48446 (patch) | |
tree | 88df16804fb239fa58f3f4e71867b3e4db5821f3 | |
parent | Fix axel definition (diff) | |
download | ilt-ba761a571ab9d62fa21e78d1b53f885f82b48446.tar.bz2 ilt-ba761a571ab9d62fa21e78d1b53f885f82b48446.tar.xz ilt-ba761a571ab9d62fa21e78d1b53f885f82b48446.zip |
Fixed up vector operator+ element
-rw-r--r-- | lib/collections.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<T...> & in, std::vector<T...> && src) return in; } -template<typename... T> +template<typename... T, typename Vn> constexpr auto -operator+(std::vector<T...> && in, std::vector<T...> && src) +operator+(const std::vector<T...> & 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>(vn)); + return out; } template<template<typename> typename Direction = std::plus> |