From 1d4db22d6226e21b507975c59a13975bd0416b35 Mon Sep 17 00:00:00 2001 From: jim Date: Wed, 16 Nov 2022 11:33:16 -0800 Subject: [PATCH] Added move constructor/operator --- include/SFML/Graphics/Shader.hpp | 13 +++++++++++++ test/Graphics/Shader.test.cpp | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/SFML/Graphics/Shader.hpp b/include/SFML/Graphics/Shader.hpp index ac945336..fbe628d4 100644 --- a/include/SFML/Graphics/Shader.hpp +++ b/include/SFML/Graphics/Shader.hpp @@ -111,6 +111,19 @@ public: //////////////////////////////////////////////////////////// Shader& operator=(const Shader&) = delete; + //////////////////////////////////////////////////////////// + /// \brief Defaulted move constructor + /// + //////////////////////////////////////////////////////////// + Shader(Shader&&) noexcept = default; + + //////////////////////////////////////////////////////////// + /// \brief Defaulted move assignment + /// + //////////////////////////////////////////////////////////// + Shader& operator=(Shader&&) noexcept = default; + + //////////////////////////////////////////////////////////// /// \brief Load the vertex, geometry or fragment shader from a file /// diff --git a/test/Graphics/Shader.test.cpp b/test/Graphics/Shader.test.cpp index 4008895b..64f101d5 100644 --- a/test/Graphics/Shader.test.cpp +++ b/test/Graphics/Shader.test.cpp @@ -4,5 +4,5 @@ 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_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_move_assignable_v);