Skip to content

Commit cf5961e

Browse files
committed
Added back copy ctor/assignment to Wave
1 parent 70c3a26 commit cf5961e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

include/Wave.hpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ class Wave : public ::Wave {
3838
set(::LoadWaveFromMemory(fileType.c_str(), fileData, dataSize));
3939
}
4040

41-
Wave(const Wave&) = delete;
41+
Wave(const Wave& other) {
42+
set(other.Copy());
43+
};
4244

4345
Wave(Wave&& other) {
4446
set(other);
@@ -68,7 +70,10 @@ class Wave : public ::Wave {
6870
return *this;
6971
}
7072

71-
Wave& operator=(const Wave&) = delete;
73+
Wave& operator=(const Wave& other) {
74+
Unload();
75+
set(other.Copy());
76+
};
7277

7378
Wave& operator=(Wave&& other) {
7479
if (this != &other) {
@@ -98,7 +103,7 @@ class Wave : public ::Wave {
98103
/**
99104
* Copy a wave to a new wave
100105
*/
101-
inline ::Wave Copy() {
106+
inline ::Wave Copy() const {
102107
return ::WaveCopy(*this);
103108
}
104109

0 commit comments

Comments
 (0)