mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-09 23:22:33 -04:00
parent
ea238f4988
commit
195a6224a0
3 changed files with 65 additions and 15 deletions
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue