tag/Item: added operator== to TagItem

This commit is contained in:
gd 2025-01-29 08:34:03 +02:00
parent 93bf99f639
commit 3e9c2cce71

@ -5,6 +5,7 @@
#define MPD_TAG_ITEM_HXX
#include <cstdint>
#include <cstring>
enum TagType : uint8_t;
@ -22,6 +23,11 @@ struct TagItem {
*/
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(const TagItem &other) = delete;
TagItem &operator=(const TagItem &other) = delete;