mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-13 06:17:42 +00:00
@@ -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);
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user