Namespaces
Variants

indirectly-binary-left-foldable, indirectly-binary-right-foldable

From cppreference.com
 
 
Algorithm library
Constrained algorithms and algorithms on ranges (C++20)
Constrained algorithms, e.g. ranges::copy, ranges::sort, ...
Non-modifying sequence operations    
Batch operations
(C++17)
Search operations
Modifying sequence operations
Copy operations
(C++11)
(C++11)
Swap operations
Transformation operations
Generation operations
Removing operations
Order-changing operations
(until C++17)(C++11)
(C++20)(C++20)
Sampling operations
(C++17)

Sorting and related operations
Partitioning operations
(C++11)    

Sorting operations
Binary search operations
(on partitioned ranges)
Set operations (on sorted ranges)
Merge operations (on sorted ranges)
Heap operations
Minimum/maximum operations
(C++11)
(C++17)
Lexicographical comparison operations
Permutation operations


 
Constrained algorithms
All names in this menu belong to namespace std::ranges
Non-modifying sequence operations
Fold operations (Helper templates)
Modifying sequence operations
Partitioning operations
Sorting operations
Binary search operations (on sorted ranges)
       
       
Set operations (on sorted ranges)
Heap operations
Minimum/maximum operations
       
       
Permutation operations
Specialized <memory> algorithms
Return types
 
template< class F, class T, class I >
concept /*indirectly-binary-left-foldable*/ =
    std::copy_constructible<F> &&
    std::indirectly_readable<I> &&
    std::invocable<F&, T, std::iter_reference_t<I>> &&
    std::convertible_to<std::invoke_result_t
        <F&, T, std::iter_reference_t<I>>,
         std::decay_t<std::invoke_result_t<F&, T, std::iter_reference_t<I>>>> &&
    /*indirectly-binary-left-foldable-impl*/
        <F, T, I,
         std::decay_t<std::invoke_result_t<F&, T, std::iter_reference_t<I>>>>;
(1) (since C++23)
(exposition only*)
template< class F, class T, class I >
concept /*indirectly-binary-right-foldable*/ =
    /*indirectly-binary-left-foldable*/</*flipped*/<F>, T, I>;
(2) (since C++23)
(exposition only*)
Helper concepts
template< class F, class T, class I, class U >
concept /*indirectly-binary-left-foldable-impl*/ =
    std::movable<T> &&
    std::movable<U> &&
    std::convertible_to<T, U> &&
    std::invocable<F&, U, std::iter_reference_t<I>> &&
    std::assignable_from
        <U&, std::invoke_result_t<F&, U, std::iter_reference_t<I>>>;
(3) (since C++23)
(exposition only*)
template< class F >
class /*flipped*/
{
    F f;    // exposition only
public:
    template< class T, class U >
        requires std::invocable<F&, U, T>
    std::invoke_result_t<F&, U, T> operator()( T&&, U&& );
};
(4) (since C++23)
(exposition only*)
1) The exposition-only concept indirectly-binary-left-foldable is used by left-folding algorithms to constrain the function object template parameter.
2) The exposition-only concept indirectly-binary-right-foldable is used by right-folding algorithms to constrain the function object template parameter.

See also

left-folds a range of elements
(algorithm function object)[edit]
left-folds a range of elements, and returns a pair (iterator, value)
(algorithm function object)[edit]
left-folds a range of elements using the first element as an initial value
(algorithm function object)[edit]
left-folds a range of elements using the first element as an initial value, and returns a pair (iterator, optional)
(algorithm function object)[edit]
right-folds a range of elements
(algorithm function object)[edit]
right-folds a range of elements using the last element as an initial value
(algorithm function object)[edit]