8#ifndef ADOBE_ALGORITHM_CLAMP_HPP
9#define ADOBE_ALGORITHM_CLAMP_HPP
45template <
typename T,
typename R>
46inline const T&
clamp(
const T& x,
const T&
min,
const T&
max, R r) {
47 return select_1_3_ac(
min, x,
max, std::bind(r, std::placeholders::_1, std::placeholders::_2));
56template <
typename T,
typename R>
58 return select_1_3_ac(
min, x,
max, std::bind(r, std::placeholders::_1, std::placeholders::_2));
68inline const T&
clamp(
const T& x,
const T&
min,
const T&
max) {
88template <
typename T,
typename R>
90 return select_1_3(
min, x,
max, std::bind(r, std::placeholders::_1, std::placeholders::_2));
98template <
typename T,
typename R>
100 return select_1_3(
min, x,
max, std::bind(r, std::placeholders::_1, std::placeholders::_2));
const T & clamp(const T &x, const T &min, const T &max, R r)
clamp implementation
const T & clamp_unordered(const T &x, const T &min, const T &max, R r)
clamp_unordered implementation
const T & max(const T &a, const T &b, R r)
minmax implementation
const T & min(const T &a, const T &b, R r)
minmax implementation
const T & select_1_3_ac(const T &a, const T &b, const T &c, R r)
select_1_ab implementation
const T & select_1_3(const T &a, const T &b, const T &c, R r)
select_1 implementation