tag/Item: added operator== to TagItem
This commit is contained in:
parent
93bf99f639
commit
3e9c2cce71
@ -5,6 +5,7 @@
|
|||||||
#define MPD_TAG_ITEM_HXX
|
#define MPD_TAG_ITEM_HXX
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
enum TagType : uint8_t;
|
enum TagType : uint8_t;
|
||||||
|
|
||||||
@ -22,6 +23,11 @@ struct TagItem {
|
|||||||
*/
|
*/
|
||||||
char value[1];
|
char value[1];
|
||||||
|
|
||||||
|
bool operator==(const TagItem &other) const noexcept {
|
||||||
|
return (this == &other) ? true :
|
||||||
|
type == other.type && std::strcmp(value, other.value) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
TagItem() = default;
|
TagItem() = default;
|
||||||
TagItem(const TagItem &other) = delete;
|
TagItem(const TagItem &other) = delete;
|
||||||
TagItem &operator=(const TagItem &other) = delete;
|
TagItem &operator=(const TagItem &other) = delete;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user