Title
transform_reduce(exec, first1, last1, first2, init) discards execution policy
Status
c++20
Section
[transform.reduce]
Submitter
Billy Robert O'Neal III

Created on 2017-12-15.00:00:00 last changed 38 months ago

Messages

Date: 2018-03-18.16:03:30

Proposed resolution:

This wording is relative to N4713.

  1. Modify [transform.reduce] as indicated:

    template<class InputIterator1, class InputIterator2, class T>
      T transform_reduce(InputIterator1 first1, InputIterator1 last1,
                         InputIterator2 first2,
                         T init);
    

    -?- Effects: Equivalent to:

    return transform_reduce(first1, last1, first2, init, plus<>(), multiplies<>());
    
    template<class ExecutionPolicy,
             class ForwardIterator1, class ForwardIterator2, class T>
      T transform_reduce(ExecutionPolicy&& exec,
                         ForwardIterator1 first1, ForwardIterator1 last1,
                         ForwardIterator2 first2,
                         T init);
    

    -1- Effects: Equivalent to:

    return transform_reduce(std::forward<ExecutionPolicy>(exec), first1, last1, first2, init, plus<>(), 
    multiplies<>());
    
Date: 2018-03-17.00:00:00

[ 2018-3-17 Adopted in Jacksonville ]

Date: 2018-01-15.00:00:00

[ 2018-01-15 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]

Date: 2017-12-15.00:00:00

Since there exists only one common Effects element for both the parallel and the non-parallel form of transform_reduce without explicit operation parameters, the current specification of a function call std::transform_reduce(exec, first1, last1, first2, init) has the same effect as if the ExecutionPolicy would have been ignored. Presumably this effect is unintended.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2018-03-18 16:03:30adminsetmessages: + msg9754
2018-03-18 16:03:30adminsetstatus: voting -> wp
2018-02-12 01:13:49adminsetstatus: ready -> voting
2018-01-20 14:17:37adminsetmessages: + msg9609
2018-01-20 14:17:37adminsetstatus: new -> ready
2017-12-16 11:20:15adminsetmessages: + msg9596
2017-12-15 00:00:00admincreate