| Home | Libraries | People | FAQ | More

## Function template clamp_range

boost::algorithm::clamp_range

## Synopsis

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

    template<typename InputIterator, typename OutputIterator, typename Pred>
      OutputIterator
      clamp_range(InputIterator first, InputIterator last, OutputIterator out,
                  typename std::iterator_traits< InputIterator >::value_type lo,
                  typename std::iterator_traits< InputIterator >::value_type hi,
                  Pred p);

## Description

Parameters: |
`first` | The start of the range of values
`hi` | The upper bound of the range to be clamped to
`last` | One past the end of the range of input values
`lo` | The lower bound of the range to be clamped to
`out` | An output iterator to write the clamped values into
`p` | A predicate to use to compare the values. p ( a, b ) returns a boolean.
Returns: | clamp the sequence of values [first, last) into [ lo, hi ] using the comparison predicate p.