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

Header <boost/algorithm/cxx17/reduce.hpp>

Combine the elements of a sequence into a single value.

Marshall Clow

namespace boost {
  namespace algorithm {
    template<typename InputIterator, typename T, typename BinaryOperation> 
      T reduce(InputIterator first, InputIterator last, T init, 
               BinaryOperation bOp);
    template<typename InputIterator, typename T> 
      T reduce(InputIterator first, InputIterator last, T init);
    template<typename InputIterator> 
      std::iterator_traits< InputIterator >::value_type 
      reduce(InputIterator first, InputIterator last);
    template<typename Range> 
      boost::range_value< Range >::type reduce(const Range & r);
    template<typename Range, typename T> T reduce(const Range & r, T init);
    template<typename Range, typename T, typename BinaryOperation> 
      T reduce(const Range & r, T init, BinaryOperation bOp);
  }
}

PrevUpHomeNext