Commit 97ae5943 authored by Max Kellermann's avatar Max Kellermann

DetachedSong: use C++11 initializers

parent 3f321ae9
...@@ -63,18 +63,18 @@ class DetachedSong { ...@@ -63,18 +63,18 @@ class DetachedSong {
Tag tag; Tag tag;
time_t mtime; time_t mtime = 0;
/** /**
* Start of this sub-song within the file. * Start of this sub-song within the file.
*/ */
SongTime start_time; SongTime start_time = SongTime::zero();
/** /**
* End of this sub-song within the file. * End of this sub-song within the file.
* Unused if zero. * Unused if zero.
*/ */
SongTime end_time; SongTime end_time = SongTime::zero();
explicit DetachedSong(const LightSong &other); explicit DetachedSong(const LightSong &other);
...@@ -82,26 +82,18 @@ public: ...@@ -82,26 +82,18 @@ public:
explicit DetachedSong(const DetachedSong &) = default; explicit DetachedSong(const DetachedSong &) = default;
explicit DetachedSong(const char *_uri) explicit DetachedSong(const char *_uri)
:uri(_uri), :uri(_uri) {}
mtime(0),
start_time(SongTime::zero()), end_time(SongTime::zero()) {}
explicit DetachedSong(const std::string &_uri) explicit DetachedSong(const std::string &_uri)
:uri(_uri), :uri(_uri) {}
mtime(0),
start_time(SongTime::zero()), end_time(SongTime::zero()) {}
explicit DetachedSong(std::string &&_uri) explicit DetachedSong(std::string &&_uri)
:uri(std::move(_uri)), :uri(std::move(_uri)) {}
mtime(0),
start_time(SongTime::zero()), end_time(SongTime::zero()) {}
template<typename U> template<typename U>
DetachedSong(U &&_uri, Tag &&_tag) DetachedSong(U &&_uri, Tag &&_tag)
:uri(std::forward<U>(_uri)), :uri(std::forward<U>(_uri)),
tag(std::move(_tag)), tag(std::move(_tag)) {}
mtime(0),
start_time(SongTime::zero()), end_time(SongTime::zero()) {}
DetachedSong(DetachedSong &&) = default; DetachedSong(DetachedSong &&) = default;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment