From 3711125b7da99f4b326e0ec9ddd0328a67539d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 21 Mar 2020 17:47:18 +0100 Subject: [PATCH] Animation: now that STL is gone, Player can be noexcept-movable. Reverts 2c5f97dacd40e427184c5317b91728c23545e195. Use C++, they said. Trust the vendors, they said. --- src/Magnum/Animation/Player.h | 8 ++------ src/Magnum/Animation/Player.hpp | 4 ++-- src/Magnum/Animation/Test/PlayerTest.cpp | 3 +++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Magnum/Animation/Player.h b/src/Magnum/Animation/Player.h index 764527214..d4ca70af9 100644 --- a/src/Magnum/Animation/Player.h +++ b/src/Magnum/Animation/Player.h @@ -278,10 +278,7 @@ template&) = delete; /** @brief Move constructor */ - /* The noexcept specifier was removed because it causes *extreme* - issues on various Clang versions (iOS, Android, Emscripten) - currently used on Travis CI. Not on my stock 6.0 or NDK r17 tho. */ - Player(Player&&); + Player(Player&&) noexcept; ~Player(); @@ -289,8 +286,7 @@ template& operator=(const Player&) = delete; /** @brief Move assignment */ - /* Deliberately not noexcept, see above */ - Player& operator=(Player&&); + Player& operator=(Player&&) noexcept; /** @brief Time-to-key scaler */ Scaler scaler() const { return _scaler; } diff --git a/src/Magnum/Animation/Player.hpp b/src/Magnum/Animation/Player.hpp index 794d09c9f..de6dd492e 100644 --- a/src/Magnum/Animation/Player.hpp +++ b/src/Magnum/Animation/Player.hpp @@ -76,9 +76,9 @@ template void Player::advance(const T time, const std::i for(Player& p: players) p.advance(time); } -template Player::Player(Player&&) = default; +template Player::Player(Player&&) noexcept = default; -template Player& Player::operator=(Player&&) = default; +template Player& Player::operator=(Player&&) noexcept = default; template Player::Player(): Player{Implementation::DefaultScaler::scale} {} diff --git a/src/Magnum/Animation/Test/PlayerTest.cpp b/src/Magnum/Animation/Test/PlayerTest.cpp index 44eeab140..2488a90d0 100644 --- a/src/Magnum/Animation/Test/PlayerTest.cpp +++ b/src/Magnum/Animation/Test/PlayerTest.cpp @@ -300,6 +300,9 @@ void PlayerTest::constructMove() { CORRADE_COMPARE(c.size(), 2); CORRADE_COMPARE(c.track(0).keys().data(), Track.keys().data()); CORRADE_COMPARE(c.track(1).keys().data(), track2.keys().data()); + + CORRADE_VERIFY(std::is_nothrow_move_constructible>::value); + CORRADE_VERIFY(std::is_nothrow_move_assignable>::value); } void PlayerTest::setDurationExtend() {