diff --git a/include/SFML/Audio/Sound.hpp b/include/SFML/Audio/Sound.hpp index 17816f5d..6f2c5705 100644 --- a/include/SFML/Audio/Sound.hpp +++ b/include/SFML/Audio/Sound.hpp @@ -60,6 +60,12 @@ public: //////////////////////////////////////////////////////////// explicit Sound(const SoundBuffer& buffer); + //////////////////////////////////////////////////////////// + /// \brief Disallow construction from a temporary sound buffer + /// + //////////////////////////////////////////////////////////// + explicit Sound(SoundBuffer&& buffer) = delete; + //////////////////////////////////////////////////////////// /// \brief Copy constructor /// @@ -125,6 +131,12 @@ public: //////////////////////////////////////////////////////////// void setBuffer(const SoundBuffer& buffer); + //////////////////////////////////////////////////////////// + /// \brief Disallow setting from a temporary sound buffer + /// + //////////////////////////////////////////////////////////// + void setBuffer(SoundBuffer&& buffer) = delete; + //////////////////////////////////////////////////////////// /// \brief Set whether or not the sound should loop after reaching the end /// diff --git a/test/Audio/Sound.test.cpp b/test/Audio/Sound.test.cpp index 727f3402..f0944d74 100644 --- a/test/Audio/Sound.test.cpp +++ b/test/Audio/Sound.test.cpp @@ -2,6 +2,7 @@ #include +static_assert(!std::is_constructible_v); static_assert(std::is_copy_constructible_v); static_assert(std::is_copy_assignable_v); static_assert(std::is_move_constructible_v);