diff --git a/source/dub/dependency.d b/source/dub/dependency.d index 39435e3..5cb6cd9 100644 --- a/source/dub/dependency.d +++ b/source/dub/dependency.d @@ -66,6 +66,19 @@ { return this.fullName; } + + /// + public int opCmp (in PackageName other) const scope @safe pure nothrow @nogc + { + import core.internal.string : dstrcmp; + return dstrcmp(this.toString(), other.toString()); + } + + /// + public bool opEquals (in PackageName other) const scope @safe pure nothrow @nogc + { + return this.toString() == other.toString(); + } } /** Encapsulates the name of a package along with its dependency specification.