...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::algorithm::clamp
// In header: <boost/algorithm/clamp.hpp> template<typename T> T const & clamp(const T & val, typename boost::mpl::identity< T >::type const & lo, typename boost::mpl::identity< T >::type const & hi);
Parameters: |
|
||||||
Returns: |
the value "val" brought into the range [ lo, hi ]. If the value is less than lo, return lo. If the value is greater than "hi", return hi. Otherwise, return the original value. |