mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-30 01:59:13 -04:00
Make better use of range_t methods.
This commit is contained in:
parent
ca3b1a2c5a
commit
7519b83379
8 changed files with 39 additions and 72 deletions
|
@ -86,6 +86,20 @@ struct range_t {
|
|||
value = reset_value;
|
||||
}
|
||||
}
|
||||
|
||||
bool below_range(const T& value) const {
|
||||
return value < minimum;
|
||||
}
|
||||
|
||||
bool contains(const T& value) const {
|
||||
// TODO: Subtle gotcha here! Range test doesn't include maximum!
|
||||
return (value >= minimum) && (value < maximum);
|
||||
}
|
||||
|
||||
bool out_of_range(const T& value) const {
|
||||
// TODO: Subtle gotcha here! Range test in contains() doesn't include maximum!
|
||||
return !contains(value);
|
||||
}
|
||||
};
|
||||
|
||||
namespace std {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue