summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
Diffstat (limited to 'compat')
-rw-r--r--compat/debug.hpp5
-rw-r--r--compat/exception.hpp3
-rw-r--r--compat/format.hpp3
-rw-r--r--compat/heap.hpp18
-rw-r--r--compat/intrusive-ptr.hpp3
-rw-r--r--compat/safe-ptr.hpp3
6 files changed, 15 insertions, 20 deletions
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 <Corrade/Utility/Debug.h>
-#include <Corrade/Utility/Move.h>
#include <Corrade/Containers/StringView.h>
#include <concepts>
@@ -70,11 +69,11 @@ auto quoted(T&& value, char c = '\'')
using U = std::remove_cvref_t<T>;
using floormat::detail::corrade_debug::Quoted;
if constexpr(std::is_rvalue_reference_v<decltype(value)>)
- return Quoted<U>{ .value = Utility::move(value), .c = c };
+ return Quoted<U>{ .value = move(value), .c = c };
else
return Quoted<const U&>{ .value = value, .c = c };
}
-template<DebugPrintable T> auto quoted2(T&& value) { return quoted(Utility::forward<T>(value), '"'); }
+template<DebugPrintable T> auto quoted2(T&& value) { return quoted(forward<T>(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 <type_traits>
#include <iterator>
#include <exception>
-#include <Corrade/Utility/Move.h>
namespace floormat {
@@ -27,7 +26,7 @@ private:
template<typename Fmt, typename... Ts>
exception::exception(const Fmt& fmt, Ts&&... args) noexcept
{
- fmt::format_to(std::back_inserter(buf), fmt, Corrade::Utility::forward<Ts>(args)...); // todo remove <iterator>
+ fmt::format_to(std::back_inserter(buf), fmt, forward<Ts>(args)...); // todo remove <iterator>
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 <fmt/compile.h>
#include <Corrade/Containers/StringView.h>
#include <Corrade/Containers/String.h>
-#include <Corrade/Utility/Move.h>
namespace fmt {
@@ -52,7 +51,7 @@ template<size_t N, typename Fmt, typename... Xs>
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>(fmt), Corrade::Utility::forward<Xs>(args)...);
+ auto result = fmt::format_to_n(buf, n, forward<Fmt>(fmt), forward<Xs>(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<It> 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<typename It, typename Compare>
@@ -29,7 +29,7 @@ void push_heap(It first, It last, Compare comp)
_push_heap(first,
std::iter_difference_t<It>((last - first) - 1),
std::iter_difference_t<It>(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<typename It, typename Compare>
@@ -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<It>(0),
std::iter_difference_t<It>(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 <compare>
-#include <Corrade/Utility/Move.h>
namespace floormat::iptr { struct non_atomic_u32_tag{}; }
@@ -273,7 +272,7 @@ fm_template template<typename... Ts>
requires std::is_constructible_v<T, Ts&&...>
constexpr fm_basic_iptr::basic_iptr(InPlaceInitT, Ts&&... args) // NOLINT(*-missing-std-forward)
noexcept(std::is_nothrow_constructible_v<T, Ts&&...>):
- _ptr{new T{Utility::forward<Ts...>(args...)}}
+ _ptr{new T{forward<Ts...>(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 <type_traits>
#include <Corrade/Tags.h>
-#include <Corrade/Utility/Move.h>
namespace floormat {
@@ -26,7 +25,7 @@ public:
safe_ptr() noexcept: safe_ptr{InPlaceInit} {}
template<typename... Ts> safe_ptr(InPlaceInitT, Ts&&... args) noexcept:
- ptr(new T{ Utility::forward<Ts>(args)... })
+ ptr(new T{ forward<Ts>(args)... })
{}
safe_ptr(const safe_ptr& other) noexcept: