Implement new serial algorithms from Parallelism TS (P0024R2)

Programming / Compilers / GCC - redi [138bc75d-0d04-0410-961f-82ee72b054a4] - 18 June 2019 23:01 EDT

These new (non-parallel) algorithms were added to C++17 along with the parallel algorithms, but were missing from libstdc++.

- include/bits/algorithmfwd.h: Change title of doc group.
- include/bits/stl_algo.h (for_each_n): Add new C++17 algorithm from P0024R2.
- include/bits/stl_numeric.h: Define doc group and add algos to it.
- include/std/numeric (__is_random_access_iter): New internal trait. (reduce, transform_reduce, exclusive_scan, inclusive_scan) (transform_exclusive_scan, transform_inclusive_scan): Likewise.
- testsuite/25_algorithms/for_each/for_each_n.cc: New test.
- testsuite/26_numerics/exclusive_scan/1.cc: New test.
- testsuite/26_numerics/inclusive_scan/1.cc: New test.
- testsuite/26_numerics/reduce/1.cc: New test.
- testsuite/26_numerics/transform_exclusive_scan/1.cc: New test.
- testsuite/26_numerics/transform_inclusive_scan/1.cc: New test.
- testsuite/26_numerics/transform_reduce/1.cc: New test.
- testsuite/util/testsuite_iterators.h (test_container::size()): New member function.

b93041f0d3c Implement new serial algorithms from Parallelism TS (P0024R2)
libstdc++-v3/ChangeLog | 17 +
libstdc++-v3/include/bits/algorithmfwd.h | 2 +-
libstdc++-v3/include/bits/stl_algo.h | 33 ++
libstdc++-v3/include/bits/stl_numeric.h | 22 +-
libstdc++-v3/include/std/numeric | 466 +++++++++++++++++++++
.../testsuite/25_algorithms/for_each/for_each_n.cc | 57 +++
.../testsuite/26_numerics/exclusive_scan/1.cc | 94 +++++
.../testsuite/26_numerics/inclusive_scan/1.cc | 123 ++++++
libstdc++-v3/testsuite/26_numerics/reduce/1.cc | 82 ++++
.../26_numerics/transform_exclusive_scan/1.cc | 65 +++
.../26_numerics/transform_inclusive_scan/1.cc | 94 +++++
.../testsuite/26_numerics/transform_reduce/1.cc | 109 +++++
libstdc++-v3/testsuite/util/testsuite_iterators.h | 4 +
13 files changed, 1159 insertions(+), 9 deletions(-)

Upstream: gcc.gnu.org


  • Share