Freq field tweaks (#1306)

* UX improvements

* Prevent wrapping
This commit is contained in:
Kyle Reed 2023-07-25 06:06:13 -07:00 committed by GitHub
parent ea238f4988
commit 195a6224a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 65 additions and 15 deletions

View file

@ -186,13 +186,18 @@ struct range_t {
return value < minimum;
}
/* Exclusive of maximum. */
constexpr bool contains(const T& value) const {
// TODO: Subtle gotcha here! Range test doesn't include maximum!
return (value >= minimum) && (value < maximum);
}
/* Inclusive of maximum. */
constexpr bool contains_inc(const T& value) const {
return (value >= minimum) && (value <= maximum);
}
/* Exclusive of maximum. */
constexpr bool out_of_range(const T& value) const {
// TODO: Subtle gotcha here! Range test in contains() doesn't include maximum!
return !contains(value);
}
};