8#ifndef RUSH_ALGORITHM_HPP
9#define RUSH_ALGORITHM_HPP
29constexpr const T &
clamp(
const T &v,
const T &lo,
const T &hi) {
30 return std::clamp(v, lo, hi);
45constexpr const T &
clampl(
const T &v,
const T &lo) {
46 return (v < lo) ? lo : v;
61constexpr const T &
clamph(
const T &v,
const T &hi) {
62 return (v > hi) ? hi : v;
constexpr const T & clamph(const T &v, const T &hi)
Clamps a value to be not greater than a specified upper bound.
Definition algorithm.hpp:61
constexpr const T & clampl(const T &v, const T &lo)
Clamps a value to be not less than a specified lower bound.
Definition algorithm.hpp:45
constexpr const T & clamp(const T &v, const T &lo, const T &hi)
Clamps a value within the inclusive range [lo, hi].
Definition algorithm.hpp:29