libexpr/symbol-table: efficiently generate ≤, <, >, ≥, ==, != for Symbol

C++ has the "spaceship" operator which can be auto-implemented and
generates efficiently a strong ordering.

Change-Id: Idfd1fd68039b395e54401cbe913454e0cbd80fb3
Signed-off-by: Raito Bezarius <raito@lix.systems>
This commit is contained in:
Raito Bezarius
2025-09-20 23:45:38 +02:00
parent 057b725ae3
commit 19e4f11e88
+1 -3
View File
@@ -106,9 +106,7 @@ public:
explicit operator bool() const { return id > 0; }
bool operator<(const Symbol other) const { return id < other.id; }
bool operator==(const Symbol other) const { return id == other.id; }
bool operator!=(const Symbol other) const { return id != other.id; }
constexpr auto operator<=>(const Symbol & other) const noexcept = default;
};
/**