Skip to content

Commit

Permalink
vecutil.hpp: forward instead of move
Browse files Browse the repository at this point in the history
  • Loading branch information
XPhyro committed Oct 13, 2023
1 parent ae4b21c commit 0985bd3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cpp/include/vecutil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace xph::vec {
inline std::vector<T> setindex(std::vector<T>&& vec, const std::size_t idx, const T& val)
{
vec[idx] = val;
return std::move(vec);
return std::forward(vec);
}

template <typename T>
Expand All @@ -23,7 +23,7 @@ namespace xph::vec {
inline std::vector<T> setindex(std::vector<T>&& vec, const std::size_t idx, const T&& val)
{
vec[idx] = val;
return std::move(vec);
return std::forward(vec);
}

template <typename T>
Expand All @@ -33,7 +33,7 @@ namespace xph::vec {
inline std::vector<T> setindex(std::vector<T>&& vec, const std::size_t&& idx, const T& val)
{
vec[idx] = val;
return std::move(vec);
return std::forward(vec);
}

template <typename T>
Expand All @@ -43,7 +43,7 @@ namespace xph::vec {
inline std::vector<T> setindex(std::vector<T>&& vec, const std::size_t&& idx, const T&& val)
{
vec[idx] = val;
return std::move(vec);
return std::forward(vec);
}
} // namespace xph::vec

Expand Down

0 comments on commit 0985bd3

Please sign in to comment.