Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Function template is_clamped

boost::algorithm::is_clamped

Synopsis

// In header: <boost/algorithm/is_clamped.hpp>


template<typename T> 
  BOOST_CXX14_CONSTEXPR bool 
  is_clamped(const T & val, 
             typename boost::type_identity< T >::type const & lo, 
             typename boost::type_identity< T >::type const & hi);

Description

Parameters:

hi

The upper bound of the range

lo

The lower bound of the range

val

The value to be checked

Returns:

true if value "val" is in the range [ lo, hi ] using operator < for comparison. If the value is less than lo, return false. If the value is greater than hi, return false. Otherwise, returns true.


PrevUpHomeNext