diff options
author | Swiftb0y <12380386+Swiftb0y@users.noreply.github.com> | 2023-05-29 11:26:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-29 11:26:42 +0200 |
commit | bf1102212f6fa2945ec0de0f09c91ee972b515f4 (patch) | |
tree | 24d5aa4c0e603f020e903ce5c4dd8cbcb4137085 | |
parent | 9d27e220321f6a9c0293b60c6b5640fb4c8b2b6d (diff) | |
parent | 26ed3e08c05d0db319240c06045f9f3c8406f427 (diff) |
Merge pull request #11573 from daschuer/comparsion_default
make defaulted comparsion operators conditional
-rw-r--r-- | src/library/itunes/itunesdao.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/library/itunes/itunesdao.h b/src/library/itunes/itunesdao.h index 783f527b64..79792b89c7 100644 --- a/src/library/itunes/itunesdao.h +++ b/src/library/itunes/itunesdao.h @@ -30,16 +30,43 @@ struct ITunesTrack { int bpm; int bitrate; +#if __cplusplus >= 202002L bool operator==(const ITunesTrack&) const = default; bool operator!=(const ITunesTrack&) const = default; +#else + bool operator==(const ITunesTrack& other) const { + return (id == other.id && + artist == other.artist && + title == other.title && + album == other.album && + albumArtist == other.albumArtist && + genre == other.genre && + grouping == other.grouping && + year == other.year && + duration == other.duration && + location == other.location && + rating == other.rating && + comment == other.comment && + trackNumber == other.trackNumber && + bpm == other.bpm && + bitrate == other.bitrate); + } +#endif }; struct ITunesPlaylist { int id; QString name; +#if __cplusplus >= 202002L bool operator==(const ITunesPlaylist&) const = default; bool operator!=(const ITunesPlaylist&) const = default; +#else + bool operator==(const ITunesPlaylist& other) const { + return (id == other.id && + name == other.name); + } +#endif }; std::ostream& operator<<(std::ostream& os, const ITunesTrack& track); |