LINUX.ORG.RU

История изменений

Исправление fsb4000, (текущая версия) :

Функциональные языки, даже весьма «чистые», имеют функции reduce, но я не видел еще ни одного языка, который имел бы реализацию reduce, безразличную к порядку прохода по элементам

В С++ не гарантируется порядок обхода при reduce. (поэтому reduce может быть многопоточным и использовать SIMD)

The behavior is non-deterministic if binary_op is not associative or not commutative.

The behavior is undefined if binary_op modifies any element or invalidates any iterator in [first; last], including the end iterator. 
in other words, reduce behaves like std::accumulate except the elements of the range may be grouped and rearranged in arbitrary order 

https://en.cppreference.com/w/cpp/algorithm/reduce

Исходная версия fsb4000, :

Функциональные языки, даже весьма «чистые», имеют функции reduce, но я не видел еще ни одного языка, который имел бы реализацию reduce, безразличную к порядку прохода по элементам

В С++ не гарантируется порядок обхода при reduce.

The behavior is non-deterministic if binary_op is not associative or not commutative.

The behavior is undefined if binary_op modifies any element or invalidates any iterator in [first; last], including the end iterator. 
in other words, reduce behaves like std::accumulate except the elements of the range may be grouped and rearranged in arbitrary order 

https://en.cppreference.com/w/cpp/algorithm/reduce