defaultKeyEqualPredOf

Default key equality/equivalence predicate for the type T.

@safe
template defaultKeyEqualPredOf (
T
) {
enum defaultKeyEqualPredOf;
enum defaultKeyEqualPredOf;
}

Examples

1 class C
2 {
3     @safe pure nothrow @nogc:
4     this(int x)
5     {
6         this.x = x;
7     }
8     @property bool opEquals(const scope typeof(this) rhs) const
9     {
10         return x == rhs.x;
11     }
12     @property override bool opEquals(const scope Object rhs) const @trusted
13     {
14         C rhs_ = cast(C)rhs;
15         return rhs_ && x == rhs_.x;
16     }
17     int x;
18 }
19 static assert(defaultKeyEqualPredOf!(C) == "a is b");

Meta