Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Song.h"
- Song::Song() : name { "unknown" }, artist{ "unknwon" }, rating(0) {}
- Song::Song(std::string n, std::string a, int c) : name(n), artist(a), rating(c) {}
- // getters
- int Song::getRating() const {
- return rating;
- }
- std::string Song::getName() const {
- return name;
- }
- std::string Song::getArtist() const {
- return artist;
- }
- //
- // overloaded functions
- bool Song::operator==(const Song& rhs) const {
- return (this->name == rhs.name) && (this->rating == rhs.rating);
- }
- bool Song::operator<(const Song& rhs) const {
- return this->rating < rhs.rating;
- }
Advertisement
Add Comment
Please, Sign In to add comment