Files
MapLibreParticleLab/include/mbgl/math/clamp.hpp
Bart Louwers 550f64be22 core: rename mbgl namespace to mln (#4487)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-08-14 23:25:20 +02:00

17 lines
295 B
C++

#pragma once
#include <mbgl/math/minmax.hpp>
#include <type_traits>
namespace mln {
namespace util {
template <typename T>
auto clamp(std::enable_if_t<std::is_scalar_v<T>, T> value, T min_, T max_) noexcept {
return max(min_, min(max_, value));
}
} // namespace util
} // namespace mln