From d4584ffcc12df81a1b6e002233350a7850f84895 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 16 Sep 2022 17:36:30 -0400 Subject: Fix incorrect use of std::move --- .clang-tidy | 1 - include/chilbert/chilbert.ipp | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index a941ce1..f2608a1 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -12,7 +12,6 @@ Checks: > -*-use-auto, -altera-*, -bugprone-easily-swappable-parameters, - -bugprone-move-forwarding-reference, -cert-oop54-cpp, -cppcoreguidelines-init-variables, -cppcoreguidelines-owning-memory, diff --git a/include/chilbert/chilbert.ipp b/include/chilbert/chilbert.ipp index 7a5b9b7..0b6587a 100644 --- a/include/chilbert/chilbert.ipp +++ b/include/chilbert/chilbert.ipp @@ -209,7 +209,7 @@ coords_to_index(const P& p, I&& scratch, size_t* const ds = nullptr) { - I e{std::move(scratch)}; + I e{std::forward(scratch)}; I l{e}; I t{e}; I w{e}; @@ -255,7 +255,7 @@ template inline void index_to_coords(P& p, const size_t m, const size_t n, const H& h, I&& scratch) { - I e{std::move(scratch)}; + I e{std::forward(scratch)}; I l{e}; I t{e}; I w{e}; @@ -327,12 +327,12 @@ coords_to_compact_index(const P& p, if (mn > SmallBitVec::bits_per_rack) { DynamicBitVec h(mn); detail::coords_to_index( - p, m, n, h, std::move(scratch), ds); + p, m, n, h, std::forward(scratch), ds); compact_index(ms, ds, n, m, h, hc); } else { SmallBitVec h(mn); detail::coords_to_index( - p, m, n, h, std::move(scratch), ds); + p, m, n, h, std::forward(scratch), ds); compact_index(ms, ds, n, m, h, hc); } @@ -349,7 +349,7 @@ compact_index_to_coords(P& p, size_t M, size_t m) { - I e{std::move(scratch)}; + I e{std::forward(scratch)}; I l{e}; I t{e}; I w{e}; -- cgit v1.2.1