mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Prevent using a temporary sf::SoundBuffer
with sf::Sound
This commit is contained in:
parent
2d0c923a53
commit
098f6927d2
@ -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
|
||||
///
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
static_assert(!std::is_constructible_v<sf::Sound, sf::SoundBuffer&&>);
|
||||
static_assert(std::is_copy_constructible_v<sf::Sound>);
|
||||
static_assert(std::is_copy_assignable_v<sf::Sound>);
|
||||
static_assert(std::is_move_constructible_v<sf::Sound>);
|
||||
|
Loading…
Reference in New Issue
Block a user