diff --git a/include/SFML/Window/Cursor.hpp b/include/SFML/Window/Cursor.hpp index 9d20f250..bd2869b2 100644 --- a/include/SFML/Window/Cursor.hpp +++ b/include/SFML/Window/Cursor.hpp @@ -145,13 +145,13 @@ public: /// \brief Move constructor /// //////////////////////////////////////////////////////////// - Cursor(Cursor&&) noexcept = default; + Cursor(Cursor&&) noexcept; //////////////////////////////////////////////////////////// /// \brief Move assignment /// //////////////////////////////////////////////////////////// - Cursor& operator=(Cursor&&) noexcept = default; + Cursor& operator=(Cursor&&) noexcept; //////////////////////////////////////////////////////////// /// \brief Create a cursor with the provided image diff --git a/src/SFML/Window/Cursor.cpp b/src/SFML/Window/Cursor.cpp index 120e2503..37a79d6c 100644 --- a/src/SFML/Window/Cursor.cpp +++ b/src/SFML/Window/Cursor.cpp @@ -44,6 +44,14 @@ Cursor::Cursor() : m_impl(std::make_unique()) Cursor::~Cursor() = default; +//////////////////////////////////////////////////////////// +Cursor::Cursor(Cursor&&) noexcept = default; + + +//////////////////////////////////////////////////////////// +Cursor& Cursor::operator=(Cursor&&) noexcept = default; + + //////////////////////////////////////////////////////////// bool Cursor::loadFromPixels(const std::uint8_t* pixels, Vector2u size, Vector2u hotspot) { diff --git a/test/Window/Cursor.test.cpp b/test/Window/Cursor.test.cpp index aafe6b26..773891ea 100644 --- a/test/Window/Cursor.test.cpp +++ b/test/Window/Cursor.test.cpp @@ -19,6 +19,22 @@ TEST_CASE("[Window] sf::Cursor" * doctest::skip(true)) const sf::Cursor cursor; } + SUBCASE("Move semantics") + { + SUBCASE("Construction") + { + sf::Cursor movedCursor; + const sf::Cursor cursor(std::move(movedCursor)); + } + + SUBCASE("Assignment") + { + sf::Cursor movedCursor; + sf::Cursor cursor; + cursor = std::move(movedCursor); + } + } + SUBCASE("loadFromPixels()") { sf::Cursor cursor;