From 92e5a1e4e6a11dcfe085770bcf57ffa61e33803a Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Thu, 30 Mar 2023 23:30:30 -0600 Subject: [PATCH] Implement move semantics for `sf::Cursor` --- include/SFML/Window/Cursor.hpp | 12 ++++++++++++ test/Window/Cursor.test.cpp | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/SFML/Window/Cursor.hpp b/include/SFML/Window/Cursor.hpp index 5f540b04..9d20f250 100644 --- a/include/SFML/Window/Cursor.hpp +++ b/include/SFML/Window/Cursor.hpp @@ -141,6 +141,18 @@ public: //////////////////////////////////////////////////////////// Cursor& operator=(const Cursor&) = delete; + //////////////////////////////////////////////////////////// + /// \brief Move constructor + /// + //////////////////////////////////////////////////////////// + Cursor(Cursor&&) noexcept = default; + + //////////////////////////////////////////////////////////// + /// \brief Move assignment + /// + //////////////////////////////////////////////////////////// + Cursor& operator=(Cursor&&) noexcept = default; + //////////////////////////////////////////////////////////// /// \brief Create a cursor with the provided image /// diff --git a/test/Window/Cursor.test.cpp b/test/Window/Cursor.test.cpp index 9fab2950..aafe6b26 100644 --- a/test/Window/Cursor.test.cpp +++ b/test/Window/Cursor.test.cpp @@ -8,8 +8,8 @@ static_assert(!std::is_copy_constructible_v); static_assert(!std::is_copy_assignable_v); -static_assert(!std::is_nothrow_move_constructible_v); -static_assert(!std::is_nothrow_move_assignable_v); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v); // Skip these tests because they fail when using DRM which hasn't implemented sf::Cursor TEST_CASE("[Window] sf::Cursor" * doctest::skip(true))