Implement new serial algorithms from Parallelism TS (P0024R2)
authorJonathan Wakely <jwakely@redhat.com>
Tue, 18 Jun 2019 23:01:16 +0000 (00:01 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 18 Jun 2019 23:01:16 +0000 (00:01 +0100)
commited920373a5faece7ea0bfdfebbd615294165c01c
treeb0e17812ec5afc3cb13a4b604dbce907aea79f23
parent1fe39f194c83e0189a239edf44d9db191c1625fa
Implement new serial algorithms from Parallelism TS (P0024R2)

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.

From-SVN: r272459
13 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/algorithmfwd.h
libstdc++-v3/include/bits/stl_algo.h
libstdc++-v3/include/bits/stl_numeric.h
libstdc++-v3/include/std/numeric
libstdc++-v3/testsuite/25_algorithms/for_each/for_each_n.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/exclusive_scan/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/inclusive_scan/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/reduce/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/transform_exclusive_scan/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/transform_inclusive_scan/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/transform_reduce/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/util/testsuite_iterators.h