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

Click here to view the latest version of this page.
PrevUpHomeNext

Reference

Header <boost/algorithm/clamp.hpp>
Header <boost/algorithm/hex.hpp>
Header <boost/algorithm/minmax.hpp>
Header <boost/algorithm/minmax_element.hpp>
Header <boost/algorithm/searching/boyer_moore.hpp>
Header <boost/algorithm/searching/boyer_moore_horspool.hpp>
Header <boost/algorithm/searching/knuth_morris_pratt.hpp>
Header <boost/algorithm/string.hpp>
Header <boost/algorithm/string_regex.hpp>

Clamp algorithm.

Marshall Clow

Suggested by olafvdspek in https://svn.boost.org/trac/boost/ticket/3215

namespace boost {
  namespace algorithm {
    template<typename T, typename Pred> 
      T const & clamp(T const &, 
                      typename boost::mpl::identity< T >::type const &, 
                      typename boost::mpl::identity< T >::type const &, Pred);
    template<typename T> 
      T const & clamp(const T &, 
                      typename boost::mpl::identity< T >::type const &, 
                      typename boost::mpl::identity< T >::type const &);
    template<typename InputIterator, typename OutputIterator> 
      OutputIterator 
      clamp_range(InputIterator, InputIterator, OutputIterator, 
                  typename std::iterator_traits< InputIterator >::value_type, 
                  typename std::iterator_traits< InputIterator >::value_type);
    template<typename Range, typename OutputIterator> 
      boost::disable_if_c< boost::is_same< Range, OutputIterator >::value, OutputIterator >::type 
      clamp_range(const Range &, OutputIterator, 
                  typename std::iterator_traits< typename boost::range_iterator< const Range >::type >::value_type, 
                  typename std::iterator_traits< typename boost::range_iterator< const Range >::type >::value_type);
    template<typename InputIterator, typename OutputIterator, typename Pred> 
      OutputIterator 
      clamp_range(InputIterator, InputIterator, OutputIterator, 
                  typename std::iterator_traits< InputIterator >::value_type, 
                  typename std::iterator_traits< InputIterator >::value_type, 
                  Pred);
    template<typename Range, typename OutputIterator, typename Pred> 
      boost::disable_if_c< boost::is_same< Range, OutputIterator >::value, OutputIterator >::type 
      clamp_range(const Range &, OutputIterator, 
                  typename std::iterator_traits< typename boost::range_iterator< const Range >::type >::value_type, 
                  typename std::iterator_traits< typename boost::range_iterator< const Range >::type >::value_type, 
                  Pred);
  }
}

PrevUpHomeNext