Final C++17 Parallel Algorithms Fixes

Published Proposal,

This version:
(Lawrence Berkeley National Laboratory)
(Just Software Solutions Ltd)
Toggle Diffs:
ISO JTC1/SC22/WG21: Programming Language C++

1. Overview

A few fixes for the C++17 parallel algorithms which should have been included in other papers slipped through the cracks.

This paper addresses NB comments US 161, US 162 and US 184.

2. Proposed Changes

The following changes are relative to the latest working paper as of 03-02-2017 ([N4640]) with the changes from [P0467r2] and [P0574r1] applied.

The � character is used to denote a placeholder section number.

2.1. Add Type Requirements From [P0574r1] To [P0452r1]'s New transform_reduce Signature

Modify the requirements for the new signatures of transform_reduce added by [P0452r1] to 26.8.4 [transform.reduce]:


Direction to the Editor: Add a footnote to the use of fully-closed ranges in the change above that says The use of fully closed ranges is intentional .

2.2. Forbid The result == first Case For Parallel adjacent_difference

Modify the remark in 26.8.11 paragraph 3 regarding whether the input and output ranges given to adjacent_difference can overlap:

3 Remarks: For the overloads with no ExecutionPolicy, result may be equal to first. For the overloads with an ExecutionPolicy, the ranges [first, last) and [result, result + (last - first)) shall not overlap.


Informative References

P0452r1: Unifying Numeric Parallel Algorithms. URL: https://wg21.link/p0452r1
Iterator Concerns for Parallel Algorithms. URL: https://wg21.link/p0467r2
Algorithm Complexity Constraints and Parallel Overloads. URL: https://wg21.link/p0574r1
Richard Smith. Working Draft, Standard for Programming Language C++. 6 February 2017. URL: https://wg21.link/n4640