diff options
-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); |