MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
clamp.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <mbgl/math/minmax.hpp>
4 
5 namespace mbgl {
6 namespace util {
7 
8 template <typename T>
9 T clamp(T value, T min_, T max_) {
10  return max(min_, min(max_, value));
11 }
12 
13 } // namespace util
14 } // namespace mbgl
T clamp(T value, T min_, T max_)
Definition: clamp.hpp:9
std::enable_if_t< std::is_integral_v< T >, T > max(T a, T b)
Definition: minmax.hpp:11
std::enable_if_t< std::is_integral_v< T >, T > min(T a, T b)
Definition: minmax.hpp:26
Definition: actor.hpp:15