cxxomfort  rel.20211024
Simple backports for C++ - https://ryan.gulix.cl/fossil.cgi/cxxomfort/
Namespaces | Functions
17-clamp.hpp File Reference

Implementation of std::clamp. More...

Namespaces

 cxxomfort
 Namespace of the cxxomfort library.
 
 cxxomfort::cxxostd
 Backports made available by cxxomfort.
 

Functions

template<class T , class Compare >
constexpr T const & clamp (T const &val, T const &lo, T const &hi, Compare comp)
 Clamps a value. More...
 
template<class T >
CXXO_CONSTEXPR T const & clamp (T const &val, T const &lo, T const &hi)
 

Detailed Description

Implementation of std::clamp.

See also
http://en.cppreference.com/w/cpp/algorithm/clamp