|  | Home | Libraries | People | FAQ | More | 
boost::algorithm::clamp
// In header: <boost/algorithm/clamp.hpp> template<typename T, typename Pred> T const & clamp(T const & val, typename boost::mpl::identity< T >::type const & lo, typename boost::mpl::identity< T >::type const & hi, Pred p);
| Parameters: | 
 | ||||||||
| Returns: | the value "val" brought into the range [ lo, hi ] using the comparison predicate p. If p ( val, lo ) return lo. If p ( hi, val ) return hi. Otherwise, return the original value. |