Skip to content

Commit 64ce13d

Browse files
committed
Add != operator to symbolt
This enables code which uses `symbolt` to check whether two symbols are different using `symbol_a != symbol_b` instead of `!(symbol_a == symbol_b)`.
1 parent 6b51aeb commit 64ce13d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/util/symbol.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,8 @@ bool symbolt::operator==(const symbolt &other) const
176176
is_volatile == other.is_volatile;
177177
// clang-format on
178178
}
179+
180+
bool symbolt::operator!=(const symbolt &other) const
181+
{
182+
return !(*this == other);
183+
}

src/util/symbol.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class symbolt
126126
bool is_well_formed() const;
127127

128128
bool operator==(const symbolt &other) const;
129+
bool operator!=(const symbolt &other) const;
129130
};
130131

131132
std::ostream &operator<<(std::ostream &out, const symbolt &symbol);

0 commit comments

Comments
 (0)