Make better use of range_t methods.

This commit is contained in:
Jared Boone 2016-01-27 14:46:45 -08:00
parent ca3b1a2c5a
commit 7519b83379
8 changed files with 39 additions and 72 deletions

View file

@ -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 {