diff --git a/src/tag/Item.hxx b/src/tag/Item.hxx
index 84bf6ae49..ea9385a28 100644
--- a/src/tag/Item.hxx
+++ b/src/tag/Item.hxx
@@ -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;