summaryrefslogtreecommitdiff
path: root/src/database/include/song.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/database/include/song.hpp')
-rw-r--r--src/database/include/song.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/database/include/song.hpp b/src/database/include/song.hpp
index e51e5587..9a84e124 100644
--- a/src/database/include/song.hpp
+++ b/src/database/include/song.hpp
@@ -4,6 +4,7 @@
#include <optional>
#include <string>
+#include <utility>
#include "leveldb/db.h"
#include "span.hpp"
@@ -133,16 +134,20 @@ class SongData {
*/
class Song {
public:
- Song(SongData data, SongTags tags) : data_(data), tags_(tags) {}
+ Song(const SongData& data, const SongTags& tags) : data_(data), tags_(tags) {}
+ Song(const Song& other) = default;
- auto data() -> const SongData& { return data_; }
- auto tags() -> const SongTags& { return tags_; }
+ auto data() const -> const SongData& { return data_; }
+ auto tags() const -> const SongTags& { return tags_; }
bool operator==(const Song&) const = default;
+ Song operator=(const Song& other) const { return Song(other); }
private:
const SongData data_;
const SongTags tags_;
};
+void swap(Song& first, Song& second);
+
} // namespace database