Mark move operators as noexcept

This commit is contained in:
Chris Thrasher 2022-10-15 00:56:45 -06:00
parent 9a4426fb35
commit 718195bf25
3 changed files with 10 additions and 4 deletions

View File

@ -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

View File

@ -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;
////////////////////////////////////////////////////////////

View File

@ -6,8 +6,14 @@
#include <fstream>
#include <sstream>
#include <string_view>
#include <type_traits>
#include <utility>
static_assert(!std::is_copy_constructible_v<sf::FileInputStream>);
static_assert(!std::is_copy_assignable_v<sf::FileInputStream>);
static_assert(std::is_nothrow_move_constructible_v<sf::FileInputStream>);
static_assert(std::is_nothrow_move_assignable_v<sf::FileInputStream>);
static std::string getTemporaryFilePath()
{
static int counter = 0;