Skip to content

Commit

Permalink
Make DustMite work with -preview=fieldwise
Browse files Browse the repository at this point in the history
  • Loading branch information
pbackus committed Jan 9, 2025
1 parent a51571a commit 00cfff2
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit 00cfff2

Please sign in to comment.