From 78a3eec9be053a1f82cf2e6235bbaa4deb4a1335 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 28 Feb 2024 18:29:02 +0100 Subject: switch to using unqualified calls to {move,forward,swap} --- compat/debug.hpp | 5 ++--- compat/exception.hpp | 3 +-- compat/format.hpp | 3 +-- compat/heap.hpp | 18 +++++++++--------- compat/intrusive-ptr.hpp | 3 +-- compat/safe-ptr.hpp | 3 +-- 6 files changed, 15 insertions(+), 20 deletions(-) (limited to 'compat') diff --git a/compat/debug.hpp b/compat/debug.hpp index 1fdd9a7e..07421673 100644 --- a/compat/debug.hpp +++ b/compat/debug.hpp @@ -1,6 +1,5 @@ #pragma once #include -#include #include #include @@ -70,11 +69,11 @@ auto quoted(T&& value, char c = '\'') using U = std::remove_cvref_t; using floormat::detail::corrade_debug::Quoted; if constexpr(std::is_rvalue_reference_v) - return Quoted{ .value = Utility::move(value), .c = c }; + return Quoted{ .value = move(value), .c = c }; else return Quoted{ .value = value, .c = c }; } -template auto quoted2(T&& value) { return quoted(Utility::forward(value), '"'); } +template auto quoted2(T&& value) { return quoted(forward(value), '"'); } } // namespace floormat diff --git a/compat/exception.hpp b/compat/exception.hpp index 155547de..8b9b8763 100644 --- a/compat/exception.hpp +++ b/compat/exception.hpp @@ -3,7 +3,6 @@ #include #include #include -#include namespace floormat { @@ -27,7 +26,7 @@ private: template exception::exception(const Fmt& fmt, Ts&&... args) noexcept { - fmt::format_to(std::back_inserter(buf), fmt, Corrade::Utility::forward(args)...); // todo remove + fmt::format_to(std::back_inserter(buf), fmt, forward(args)...); // todo remove buf.push_back('\0'); } diff --git a/compat/format.hpp b/compat/format.hpp index d0736c97..1cb4f365 100644 --- a/compat/format.hpp +++ b/compat/format.hpp @@ -4,7 +4,6 @@ #include #include #include -#include namespace fmt { @@ -52,7 +51,7 @@ template size_t snformat(char(&buf)[N], Fmt&& fmt, Xs&&... args) { constexpr size_t n = N > 0 ? N - 1 : 0; - auto result = fmt::format_to_n(buf, n, Corrade::Utility::forward(fmt), Corrade::Utility::forward(args)...); + auto result = fmt::format_to_n(buf, n, forward(fmt), forward(args)...); const auto len = n < result.size ? n : result.size; fm_assert(len > 0); #if 0 diff --git a/compat/heap.hpp b/compat/heap.hpp index e9cac8cf..3d901755 100644 --- a/compat/heap.hpp +++ b/compat/heap.hpp @@ -16,11 +16,11 @@ inline void _push_heap(It first, std::iter_difference_t parent = (holeIndex - 1) / 2; while (holeIndex > topIndex && comp(*(first + parent), value)) { - *(first + holeIndex) = std::move(*(first + parent)); + *(first + holeIndex) = move(*(first + parent)); holeIndex = parent; parent = (holeIndex - 1) / 2; } - *(first + holeIndex) = std::move(value); + *(first + holeIndex) = move(value); } template @@ -29,7 +29,7 @@ void push_heap(It first, It last, Compare comp) _push_heap(first, std::iter_difference_t((last - first) - 1), std::iter_difference_t(0), - std::move(*(last - 1)), + move(*(last - 1)), comp); } @@ -47,16 +47,16 @@ void _adjust_heap(It first, secondChild = 2 * (secondChild + 1); if (comp(*(first + secondChild), *(first + (secondChild - 1)))) secondChild--; - *(first + holeIndex) = std::move(*(first + secondChild)); + *(first + holeIndex) = move(*(first + secondChild)); holeIndex = secondChild; } if ((len & 1) == 0 && secondChild == (len - 2) / 2) { secondChild = 2 * (secondChild + 1); - *(first + holeIndex) = std::move(*(first + (secondChild - 1))); + *(first + holeIndex) = move(*(first + (secondChild - 1))); holeIndex = secondChild - 1; } - _push_heap(first, holeIndex, topIndex, std::move(value), comp); + _push_heap(first, holeIndex, topIndex, move(value), comp); } template @@ -65,12 +65,12 @@ void pop_heap(It first, It last, Compare comp) if (last - first > 1) { --last; - auto value = std::move(*last); - *last = std::move(*first); + auto value = move(*last); + *last = move(*first); _adjust_heap(first, std::iter_difference_t(0), std::iter_difference_t(last - first), - std::move(value), + move(value), comp); } } diff --git a/compat/intrusive-ptr.hpp b/compat/intrusive-ptr.hpp index 0d09a366..7cc15494 100644 --- a/compat/intrusive-ptr.hpp +++ b/compat/intrusive-ptr.hpp @@ -1,7 +1,6 @@ #pragma once #include "compat/assert.hpp" #include -#include namespace floormat::iptr { struct non_atomic_u32_tag{}; } @@ -273,7 +272,7 @@ fm_template template requires std::is_constructible_v constexpr fm_basic_iptr::basic_iptr(InPlaceInitT, Ts&&... args) // NOLINT(*-missing-std-forward) noexcept(std::is_nothrow_constructible_v): - _ptr{new T{Utility::forward(args...)}} + _ptr{new T{forward(args...)}} { ops_t::init_to_1(_ptr); } diff --git a/compat/safe-ptr.hpp b/compat/safe-ptr.hpp index 68c17c76..2a77ea72 100644 --- a/compat/safe-ptr.hpp +++ b/compat/safe-ptr.hpp @@ -3,7 +3,6 @@ #include "compat/defs.hpp" #include #include -#include namespace floormat { @@ -26,7 +25,7 @@ public: safe_ptr() noexcept: safe_ptr{InPlaceInit} {} template safe_ptr(InPlaceInitT, Ts&&... args) noexcept: - ptr(new T{ Utility::forward(args)... }) + ptr(new T{ forward(args)... }) {} safe_ptr(const safe_ptr& other) noexcept: -- cgit v1.2.3