From 2b2f8b1ef1c6eadb131fd8100be15106ef901ac3 Mon Sep 17 00:00:00 2001 From: JJCUBER <34446698+JJCUBER@users.noreply.github.com> Date: Fri, 3 Apr 2026 06:39:29 -0400 Subject: [PATCH] Add missing const in cf hashing Without operator ull() being marked const, it causes a compilation error on some compilers due to const functions operator==, operator< calling it. --- content/strings/Hashing-codeforces.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/strings/Hashing-codeforces.h b/content/strings/Hashing-codeforces.h index 5129112db..7b1a3dcb4 100644 --- a/content/strings/Hashing-codeforces.h +++ b/content/strings/Hashing-codeforces.h @@ -21,7 +21,7 @@ struct A { A operator+(A o){int y = x+o.x; return{y - (y>=M)*M, b+o.b};} A operator-(A o){int y = x-o.x; return{y + (y< 0)*M, b-o.b};} A operator*(A o) { return {(int)(1LL*x*o.x % M), b*o.b}; } - explicit operator ull() { return x ^ (ull) b << 21; } + explicit operator ull() const { return x ^ (ull) b << 21; } bool operator==(A o) const { return (ull)*this == (ull)o; } bool operator<(A o) const { return (ull)*this < (ull)o; } };