Created on 2016-03-23.00:00:00 last changed 89 months ago
Proposed resolution:
This wording is relative to N4582.
Insert the following paragraphs after [alg.copy]/4:
template<class ExecutionPolicy, class InputIterator, class OutputIterator> OutputIterator copy(ExecutionPolicy&& policy, InputIterator first, InputIterator last, OutputIterator result);-?- Requires: The ranges [first, last) and [result, result + (last - first)) shall not overlap.
-?- Effects: Copies elements in the range [first, last) into the range [result, result + (last - first)). For each non-negative integer n < (last - first), performs *(result + n) = *(first + n). -?- Returns: result + (last - first). -?- Complexity: Exactly last - first assignments.
Insert the following paragraphs after [alg.move]/4:
template<class ExecutionPolicy, class InputIterator, class OutputIterator> OutputIterator move(ExecutionPolicy&& policy, InputIterator first, InputIterator last, OutputIterator result);-?- Requires: The ranges [first, last) and [result, result + (last - first)) shall not overlap.
-?- Effects: Moves elements in the range [first, last) into the range [result, result + (last - first)). For each non-negative integer n < (last - first), performs *(result + n) = std::move(*(first + n)). -?- Returns: result + (last - first). -?- Complexity: Exactly last - first assignments.
[ 2016-05 Issues Telecon ]
Marshall noted that all three versions of copy have subtly different wording, and suggested that they should not.
[algorithms.parallel.overloads]/2 says that "Unless otherwise specified, the semantics of ExecutionPolicy algorithm overloads are identical to their overloads without."
There's no "otherwise specified" for the ExecutionPolicy overloads for std::copy and std::move, so the requirement that they "start[] from first and proceed[] to last" in the original algorithm's description would seem to apply, which defeats the whole point of adding a parallel overload.History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2016-06-28 12:50:44 | admin | set | status: ready -> wp |
2016-05-22 15:38:38 | admin | set | messages: + msg8136 |
2016-05-22 15:38:38 | admin | set | status: new -> ready |
2016-05-06 17:10:28 | admin | set | messages: + msg8079 |
2016-03-23 00:00:00 | admin | create |