summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorljfa-ag <ljfa-ag@web.de>2015-07-01 19:17:50 +0200
committerljfa-ag <ljfa-ag@web.de>2015-07-01 19:30:23 +0200
commitd648754b1f35e7a6465869157ae9afa0b0ee451d (patch)
treec6a7a769fc6139fe4607d096a74f71fefbe228d1 /src
parent8fef19528e0f6a68621d58ef9dd9cb75fc163657 (diff)
downloadProject-Tick-d648754b1f35e7a6465869157ae9afa0b0ee451d.tar.gz
Project-Tick-d648754b1f35e7a6465869157ae9afa0b0ee451d.zip
Overload operator== for each tag individually
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);
}
}