Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions DustMite/polyhash.d
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ if (isUnsigned!T)
return value == operand;
}

bool opEquals(ModQ other) const
{
return this == other.value;
}

void opOpAssign(string op : "+")(typeof(this) operand)
{
T result = this.value;
Expand All @@ -170,6 +175,11 @@ if (isUnsigned!T)
// Ensure this type is supported whet it is instantiated,
// instead of when the operator overloads are
private static void check() { typeof(this) m; m *= typeof(this)(0); }

size_t toHash() const
{
return hashOf(value);
}
}

unittest
Expand Down