diff --git a/src/misc.h b/src/misc.h index 0a6a846c2..eee6858cb 100644 --- a/src/misc.h +++ b/src/misc.h @@ -381,7 +381,7 @@ class RelaxedAtomic { return inner; } - RelaxedAtomic& operator+=(int val) { + RelaxedAtomic& operator+=(T val) { T res = this->load(std::memory_order_relaxed) + val; this->store(res, std::memory_order_relaxed); return *this; @@ -411,7 +411,7 @@ class RelaxedAtomic { return val; } - RelaxedAtomic& operator-=(int val) { + RelaxedAtomic& operator-=(T val) { T res = this->load(std::memory_order_relaxed) - val; this->store(res, std::memory_order_relaxed); return *this;