10namespace utils::statistics {
16 using ValueType = std::uint64_t;
20 inline Rate& operator+=(
Rate other)
noexcept {
25 explicit operator
bool()
const noexcept {
return value != 0; }
27 Rate operator-(
Rate rhs)
const noexcept {
return {value - rhs.value}; }
29 bool operator==(
Rate rhs)
const noexcept {
return value == rhs.value; }
31 bool operator!=(
Rate rhs)
const noexcept {
return !(*
this == rhs); }
33 bool operator<(
Rate rhs)
const noexcept {
return value < rhs.value; }
35 bool operator>(
Rate rhs)
const noexcept {
return rhs < *
this; }
37 bool operator<=(
Rate rhs)
const noexcept {
return !(rhs < *
this); }
39 bool operator>=(
Rate rhs)
const noexcept {
return !(*
this < rhs); }
41 bool operator==(std::uint64_t rhs)
const noexcept {
return value == rhs; }
43 bool operator!=(std::uint64_t rhs)
const noexcept {
return value != rhs; }
45 bool operator<(std::uint64_t rhs)
const noexcept {
return value < rhs; }
47 bool operator>(std::uint64_t rhs)
const noexcept {
return value > rhs; }
49 bool operator<=(std::uint64_t rhs)
const noexcept {
return value <= rhs; }
51 bool operator>=(std::uint64_t rhs)
const noexcept {
return value >= rhs; }
54inline Rate operator+(
Rate first,
Rate second)
noexcept {
return Rate{first.value + second.value}; }