Utility functions for working with value limits. More...
Classes | |
class | StaticLimiter |
Compile-time value limiter with fixed bounds. More... | |
Functions | |
constexpr int | minFromPair (ValueLimitSimplePair p) noexcept |
Gets the minimum value from a pair. | |
constexpr int | maxFromPair (ValueLimitSimplePair p) noexcept |
Gets the maximum value from a pair. | |
constexpr bool | inBound (ValueLimitType value, ValueLimitSimplePair p) |
Checks if a value is within bounds. | |
constexpr ValueLimitType | boundWithPair (const ValueLimitType value, const ValueLimitSimplePair vp) |
Clamps a value to the specified bounds. | |
Utility functions for working with value limits.
|
constexpr |
Clamps a value to the specified bounds.
value | The value to clamp |
vp | The min/max bounds pair |
std::logic_error | if min > max in the bounds pair |
|
constexpr |
Checks if a value is within bounds.
value | The value to check |
p | The min/max bounds pair |
|
constexprnoexcept |
Gets the maximum value from a pair.
p | The min/max pair |
|
constexprnoexcept |
Gets the minimum value from a pair.
p | The min/max pair |