From 718195bf25eb747a549207daf734976a44ec6545 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sat, 15 Oct 2022 00:56:45 -0600 Subject: [PATCH] Mark move operators as noexcept --- include/SFML/System/FileInputStream.hpp | 4 ++-- src/SFML/System/FileInputStream.cpp | 4 ++-- test/System/FileInputStream.test.cpp | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/SFML/System/FileInputStream.hpp b/include/SFML/System/FileInputStream.hpp index 30079fb06..875a18c42 100644 --- a/include/SFML/System/FileInputStream.hpp +++ b/include/SFML/System/FileInputStream.hpp @@ -83,13 +83,13 @@ public: /// \brief Move constructor /// //////////////////////////////////////////////////////////// - FileInputStream(FileInputStream&&); + FileInputStream(FileInputStream&&) noexcept; //////////////////////////////////////////////////////////// /// \brief Move assignment /// //////////////////////////////////////////////////////////// - FileInputStream& operator=(FileInputStream&&); + FileInputStream& operator=(FileInputStream&&) noexcept; //////////////////////////////////////////////////////////// /// \brief Open the stream from a file path diff --git a/src/SFML/System/FileInputStream.cpp b/src/SFML/System/FileInputStream.cpp index 2f919ec28..63e65582e 100644 --- a/src/SFML/System/FileInputStream.cpp +++ b/src/SFML/System/FileInputStream.cpp @@ -52,11 +52,11 @@ FileInputStream::~FileInputStream() = default; //////////////////////////////////////////////////////////// -FileInputStream::FileInputStream(FileInputStream&&) = default; +FileInputStream::FileInputStream(FileInputStream&&) noexcept = default; //////////////////////////////////////////////////////////// -FileInputStream& FileInputStream::operator=(FileInputStream&&) = default; +FileInputStream& FileInputStream::operator=(FileInputStream&&) noexcept = default; //////////////////////////////////////////////////////////// diff --git a/test/System/FileInputStream.test.cpp b/test/System/FileInputStream.test.cpp index e8fac5578..384d51fad 100644 --- a/test/System/FileInputStream.test.cpp +++ b/test/System/FileInputStream.test.cpp @@ -6,8 +6,14 @@ #include #include #include +#include #include +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 std::string getTemporaryFilePath() { static int counter = 0;