Skip to content

Commit 413da96

Browse files
authored
Add missing const in cf hashing (#313)
Without operator ull() being marked const, it causes a compilation error on some compilers due to const functions operator==, operator< calling it.
1 parent a1b95ab commit 413da96

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

content/strings/Hashing-codeforces.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct A {
2121
A operator+(A o){int y = x+o.x; return{y - (y>=M)*M, b+o.b};}
2222
A operator-(A o){int y = x-o.x; return{y + (y< 0)*M, b-o.b};}
2323
A operator*(A o) { return {(int)(1LL*x*o.x % M), b*o.b}; }
24-
explicit operator ull() { return x ^ (ull) b << 21; }
24+
explicit operator ull() const { return x ^ (ull) b << 21; }
2525
bool operator==(A o) const { return (ull)*this == (ull)o; }
2626
bool operator<(A o) const { return (ull)*this < (ull)o; }
2727
};

0 commit comments

Comments
 (0)