Implement move semantics for sf::Cursor

This commit is contained in:
Chris Thrasher 2023-03-30 23:30:30 -06:00
parent d500eee682
commit 92e5a1e4e6
2 changed files with 14 additions and 2 deletions

View File

@ -141,6 +141,18 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Cursor& operator=(const Cursor&) = delete; 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 /// \brief Create a cursor with the provided image
/// ///

View File

@ -8,8 +8,8 @@
static_assert(!std::is_copy_constructible_v<sf::Cursor>); static_assert(!std::is_copy_constructible_v<sf::Cursor>);
static_assert(!std::is_copy_assignable_v<sf::Cursor>); static_assert(!std::is_copy_assignable_v<sf::Cursor>);
static_assert(!std::is_nothrow_move_constructible_v<sf::Cursor>); static_assert(std::is_nothrow_move_constructible_v<sf::Cursor>);
static_assert(!std::is_nothrow_move_assignable_v<sf::Cursor>); static_assert(std::is_nothrow_move_assignable_v<sf::Cursor>);
// Skip these tests because they fail when using DRM which hasn't implemented sf::Cursor // Skip these tests because they fail when using DRM which hasn't implemented sf::Cursor
TEST_CASE("[Window] sf::Cursor" * doctest::skip(true)) TEST_CASE("[Window] sf::Cursor" * doctest::skip(true))