diff --git a/actypes.d b/actypes.d index 29ab41f..70bf67a 100644 --- a/actypes.d +++ b/actypes.d @@ -90,7 +90,7 @@ public: this.type = type; } - int opCmp(ref const ACSymbol other) const + int opCmp(ref const ACSymbol other) const pure nothrow @safe { // Compare the pointers because the strings have been interned. // Identical strings MUST have the same address @@ -101,6 +101,16 @@ public: return 0; } + bool opEquals(ref const ACSymbol other) const pure nothrow @safe + { + return other.name.ptr == this.name.ptr; + } + + size_t toHash() const pure nothrow @safe + { + return (cast(size_t) name.ptr) * 27_644_437; + } + /** * Gets all parts whose name matches the given string. */