Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make defaulted comparsion operators conditional #11573

Merged
merged 1 commit into from
May 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/library/itunes/itunesdao.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down