Skip to content

futures::binary_invoke_algorithm_functor

Algorithms / Algorithm Traits / binary_invoke_algorithm_functor

Defined in header <futures/algorithm/traits/binary_invoke_algorithm.hpp>

template <class Derived> 
class binary_invoke_algorithm_functor;

Binary algorithm overloads.

Description

CRTP class with the overloads for algorithms that aggregate elements in a sequence with an binary function.

This includes algorithms such as reduce and accumulate.

Inherited by: binary_invoke_algorithm_functor is a base class for reduce_functor

Public Functions

Member Functions Description
operator() const Execute the underlying algorithm.
(function template)

Public Functions

function operator()

Defined in header <futures/algorithm/traits/binary_invoke_algorithm.hpp>

(1)
template <
    executor E, 
    std::input_iterator I, 
    std::sentinel_for< I > S, 
    partitioner_for< I, S > P, 
    std::convertible_to< std::iter_value_t< I > > T, 
    std::indirect_binary_predicate< I, T const * > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(
    E const & ex, 
    P p, 
    I first, 
    S last, 
    T const & value, 
    Fun f =std::plus<>()) const;
(2)
template <
    executor E, 
    std::input_iterator I, 
    std::sentinel_for< I > S, 
    partitioner_for< I, S > P, 
    std::indirect_binary_predicate< I, I > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(
    E const & ex, 
    P p, 
    I first, 
    S last, 
    Fun f =std::plus<>()) const;
(3)
template <
    execution_policy E, 
    std::input_iterator I, 
    std::sentinel_for< I > S, 
    partitioner_for< I, S > P, 
    std::convertible_to< std::iter_value_t< I > > T, 
    std::indirect_binary_predicate< I, T const * > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(
    E const &, 
    P p, 
    I first, 
    S last, 
    T const & value, 
    Fun f =std::plus<>()) const;
(4)
template <
    execution_policy E, 
    std::input_iterator I, 
    std::sentinel_for< I > S, 
    partitioner_for< I, S > P, 
    std::indirect_binary_predicate< I, I > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(E const &, P p, I first, S last, Fun f =std::plus<>()) const;
(5)
template <
    executor E, 
    std::ranges::range R, 
    partitioner_for< std::ranges::iterator_t< R > > P, 
    std::convertible_to< std::ranges::range_value_t< R > > T, 
    std::indirect_binary_predicate< std::ranges::iterator_t< R >, T const * > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(
    E const & ex, 
    P p, 
    R && r, 
    T const & value, 
    Fun f =std::plus<>()) const;
(6)
template <
    executor E, 
    std::ranges::range R, 
    partitioner_for< std::ranges::iterator_t< R > > P, 
    std::convertible_to< std::ranges::range_value_t< R > > T, 
    std::indirect_binary_predicate< std::ranges::iterator_t< R >, T const * > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(
    E const & ex, 
    P p, 
    R && r, 
    T const & value, 
    Fun f =std::plus<>()) const;
(7)
template <
    executor E, 
    std::ranges::range R, 
    partitioner_for< std::ranges::iterator_t< R > > P, 
    std::indirect_binary_predicate< std::ranges::iterator_t< R >, std::ranges::iterator_t< R > > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(E const & ex, P p, R && r, Fun f =std::plus<>()) const;
(8)
template <
    executor E, 
    std::ranges::range R, 
    partitioner_for< std::ranges::iterator_t< R > > P, 
    std::indirect_binary_predicate< std::ranges::iterator_t< R >, std::ranges::iterator_t< R > > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(E const & ex, P p, R && r, Fun f =std::plus<>()) const;
(9)
template <
    std::input_iterator I, 
    std::sentinel_for< I > S, 
    partitioner_for< I, S > P, 
    std::convertible_to< std::iter_value_t< I > > T, 
    std::indirect_binary_predicate< I, T const * > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(P p, I first, S last, T value, Fun f =std::plus<>()) const;
(10)
template <
    std::input_iterator I, 
    std::sentinel_for< I > S, 
    partitioner_for< I, S > P, 
    std::indirect_binary_predicate< I, I > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(P p, I first, S last, Fun f =std::plus<>()) const;
(11)
template <
    std::ranges::range R, 
    partitioner_for< std::ranges::iterator_t< R > > P, 
    std::convertible_to< std::ranges::range_value_t< R > > T, 
    std::indirect_binary_predicate< std::ranges::iterator_t< R >, T const * > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(P p, R && r, T const & value, Fun f =std::plus<>()) const;
(12)
template <
    std::ranges::range R, 
    partitioner_for< std::ranges::iterator_t< R > > P, 
    std::indirect_binary_predicate< std::ranges::iterator_t< R >, std::ranges::iterator_t< R > > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(P p, R && r, Fun f =std::plus<>()) const;
(13)
template <
    executor E, 
    std::input_iterator I, 
    std::sentinel_for< I > S, 
    std::convertible_to< std::iter_value_t< I > > T, 
    std::indirect_binary_predicate< I, T const * > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(
    E const & ex, 
    I first, 
    S last, 
    T const & value, 
    Fun f =std::plus<>()) const;
(14)
template <
    executor E, 
    std::input_iterator I, 
    std::sentinel_for< I > S, 
    std::convertible_to< std::iter_value_t< I > > T, 
    std::indirect_binary_predicate< I, T const * > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(
    E const & ex, 
    I first, 
    S last, 
    T const & value, 
    Fun f =std::plus<>()) const;
(15)
template <
    executor E, 
    std::input_iterator I, 
    std::sentinel_for< I > S, 
    std::indirect_binary_predicate< I, I > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(E const & ex, I first, S last, Fun f =std::plus<>()) const;
(16)
template <
    executor E, 
    std::input_iterator I, 
    std::sentinel_for< I > S, 
    std::indirect_binary_predicate< I, I > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(E const & ex, I first, S last, Fun f =std::plus<>()) const;
(17)
template <
    executor E, 
    std::ranges::input_range R, 
    std::convertible_to< std::ranges::range_value_t< R > > T, 
    std::indirect_binary_predicate< std::ranges::iterator_t< R >, T const * > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(
    E const & ex, 
    R && r, 
    T const & value, 
    Fun f =std::plus<>()) const;
(18)
template <
    executor E, 
    std::ranges::input_range R, 
    std::convertible_to< std::ranges::range_value_t< R > > T, 
    std::indirect_binary_predicate< std::ranges::iterator_t< R >, T const * > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(
    E const & ex, 
    R && r, 
    T const & value, 
    Fun f =std::plus<>()) const;
(19)
template <
    executor E, 
    std::ranges::input_range R, 
    std::indirect_binary_predicate< std::ranges::iterator_t< R >, std::ranges::iterator_t< R > > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(E const & ex, R && r, Fun f =std::plus<>()) const;
(20)
template <
    executor E, 
    std::ranges::input_range R, 
    std::indirect_binary_predicate< std::ranges::iterator_t< R >, std::ranges::iterator_t< R > > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(E const & ex, R && r, Fun f =std::plus<>()) const;
(21)
template <
    std::input_iterator I, 
    std::sentinel_for< I > S, 
    std::convertible_to< std::iter_value_t< I > > T, 
    std::indirect_binary_predicate< I, I > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(I first, S last, T const & value, Fun f =std::plus<>()) const;
(22)
template <
    std::input_iterator I, 
    std::sentinel_for< I > S, 
    std::indirect_binary_predicate< I, I > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(I first, S last, Fun f =std::plus<>()) const;
(23)
template <
    std::ranges::input_range R, 
    std::convertible_to< std::ranges::range_value_t< R > > T, 
    std::indirect_binary_predicate< std::ranges::iterator_t< R >, T const * > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(R && r, T const & value, Fun f =std::plus<>()) const;
(24)
template <
    std::ranges::input_range R, 
    std::indirect_binary_predicate< std::ranges::iterator_t< R >, std::ranges::iterator_t< R > > Fun =std::plus<>>
constexpr
/* see return type below */
operator()(R && r, Fun f =std::plus<>()) const;
  1. Execute the underlying algorithm.
  2. Execute the algorithm with the default initialization value.
  3. Execute the underlying algorithm with an execution policy.
  4. Execute the algorithm with an execution policy and default value.
  5. Execute the algorithm on a range of iterators.
  6. Execute the algorithm on a range with an execution policy.
  7. Execute algorithm on a range with default initialization value.
  8. Execute algorithm on a range with policy and default value.
  9. Execute underlying algorithm with default executor.
  10. Execute algorithm with default executor and default value.
  11. Execute algorithm on range with default executor.
  12. Execute algorithm on range with default executor and initialization.
  13. Execute algorithm with default partitioner.
  14. Execute algorithm with execution policy and default partitioner.
  15. Execute algorithm with default partitioner and initialization value.
  16. Execute algorithm with policy, default partitioner and default value.
  17. Execute algorithm on range with default partitioner.
  18. Execute algorithm on range with execution policy and default partitioner.
  19. Execute algorithm on range with default partitioner and value.
  20. Execute algorithm on range with policy, default partitioner and value.
  21. Execute algorithm with default executor and partitioner.
  22. Execute algorithm with default executor, partitioner, and value.
  23. Execute algorithm on range with default executor and partitioner.
  24. Execute algorithm on range with default executor, partitioner, and value.

Template Parameters

  • E - Executor type
  • Fun - Function type
  • I - Iterator type
  • P - Partitioner type
  • S - Sentinel type
  • T - Type of value to aggregate the elements with

Parameters

  • ex - An executor instance
  • f - Function invocable with the return type of the iterator
  • first - Iterator to first element in the range
  • last - Sentinel iterator to one element past the last
  • p - A partitioner instance
  • value - initial value to aggregate the elements with

Return value

Result of the underlying algorithm

Description

The default initialization value is always the first element in the sequence, while the algorithm is executed with other elements.

Exception Safety

Basic exception guarantee.


Updated on 2023-01-04