summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tag_compound.cpp12
-rw-r--r--src/tag_string.cpp12
2 files changed, 22 insertions, 2 deletions
diff --git a/src/tag_compound.cpp b/src/tag_compound.cpp
index 20cb021df8..53fd9df8ac 100644
--- a/src/tag_compound.cpp
+++ b/src/tag_compound.cpp
@@ -91,7 +91,17 @@ std::unique_ptr<tag> tag_compound::move_clone() &&
bool tag_compound::equals(const tag& rhs) const
{
- return tags == static_cast<const tag_compound&>(rhs).tags;
+ return *this == static_cast<const tag_compound&>(rhs);
+}
+
+bool operator==(const tag_compound& lhs, const tag_compound& rhs)
+{
+ return lhs.tags == rhs.tags;
+}
+
+bool operator!=(const tag_compound& lhs, const tag_compound& rhs)
+{
+ return !(lhs == rhs);
}
}
diff --git a/src/tag_string.cpp b/src/tag_string.cpp
index 6322d4a42c..b3ef075cd3 100644
--- a/src/tag_string.cpp
+++ b/src/tag_string.cpp
@@ -79,7 +79,17 @@ std::unique_ptr<tag> tag_string::move_clone() &&
bool tag_string::equals(const tag& rhs) const
{
- return value == static_cast<const tag_string&>(rhs).value;
+ return *this == static_cast<const tag_string&>(rhs);
+}
+
+bool operator==(const tag_string& lhs, const tag_string& rhs)
+{
+ return lhs.get() == rhs.get();
+}
+
+bool operator!=(const tag_string& lhs, const tag_string& rhs)
+{
+ return !(lhs == rhs);
}
}