tint: Add Symbol inequality operator
Allows Symbol to be used in a std::variant
Change-Id: If366622c39b5c25d633f6507467c9859394577c3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112283
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/symbol.cc b/src/tint/symbol.cc
index 9adc1aa..32177f6 100644
--- a/src/tint/symbol.cc
+++ b/src/tint/symbol.cc
@@ -42,6 +42,11 @@
return val_ == other.val_;
}
+bool Symbol::operator!=(const Symbol& other) const {
+ TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(Symbol, program_id_, other.program_id_);
+ return val_ != other.val_;
+}
+
bool Symbol::operator<(const Symbol& other) const {
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(Symbol, program_id_, other.program_id_);
return val_ < other.val_;