rcpputils
master
C++ API providing common utilities and data structures.
|
Functions | |
template<class T > | |
constexpr const T & | clamp (const T &v, const T &lo, const T &hi) |
If v compares less than lo, returns lo; otherwise if hi compares less. More... | |
template<class T , class Compare > | |
constexpr const T & | clamp (const T &v, const T &lo, const T &hi, Compare comp) |
Like the function above, but uses comp to compare the values. More... | |
|
constexpr |
If v compares less than lo, returns lo; otherwise if hi compares less.
[in] | v | the value to clamp |
[in] | lo | the lower boundary |
[in] | hi | the higher boundary |
|
constexpr |
Like the function above, but uses comp to compare the values.
[in] | comp | Comparison object that returns true if the first argument is less than the second |