diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-09 15:45:05 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-09 15:45:05 +0200 |
commit | 6bcc0bea59e639e20bd3244b5c2b6c001aa2a707 (patch) | |
tree | a950ef264cef1c154c35566c1311cc7128850625 /compat | |
parent | 3cae96cc3017f7d3325f0e1f20bc7960595ad310 (diff) |
b
Diffstat (limited to 'compat')
-rw-r--r-- | compat/move.hpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compat/move.hpp b/compat/move.hpp index 483de82b..ca17aa72 100644 --- a/compat/move.hpp +++ b/compat/move.hpp @@ -1,5 +1,6 @@ #pragma once #include <type_traits> +#include <Corrade/Utility/Macros.h> namespace floormat { @@ -8,26 +9,26 @@ template<typename T> concept AlwaysTrue = true; // from Corrade/Utility/Move.h template<AlwaysTrue T> -constexpr T&& forward(std::remove_reference_t<T>& t) noexcept +constexpr CORRADE_ALWAYS_INLINE T&& forward(std::remove_reference_t<T>& t) noexcept { return static_cast<T&&>(t); } template<AlwaysTrue T> -constexpr T&& forward(std::remove_reference_t<T>&& t) noexcept +constexpr CORRADE_ALWAYS_INLINE T&& forward(std::remove_reference_t<T>&& t) noexcept { static_assert(!std::is_lvalue_reference_v<T>); return static_cast<T&&>(t); } template<AlwaysTrue T> -constexpr std::remove_reference_t<T>&& move(T&& t) noexcept +constexpr CORRADE_ALWAYS_INLINE std::remove_reference_t<T>&& move(T&& t) noexcept { return static_cast<std::remove_reference_t<T>&&>(t); } template<AlwaysTrue T> -void swap(T& a, std::common_type_t<T>& b) +constexpr inline void swap(T& a, std::common_type_t<T>& b) noexcept(std::is_nothrow_move_constructible_v<T> && std::is_nothrow_move_assignable_v<T>) { T tmp = static_cast<T&&>(a); |