From c03bf35f63ac5ec85ca55f213a70ed9a4d1e55aa Mon Sep 17 00:00:00 2001 From: redi Date: Tue, 1 Oct 2019 21:02:27 +0000 Subject: [PATCH] Make some new algorithms work in parallel mode * include/experimental/algorithm (experimental::sample): Qualify call to __sample correctly. * include/parallel/algo.h (sample, for_each_n): Add using-declarations for algorithms that don't have parallel implementations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@276432 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/include/experimental/algorithm | 6 +++--- libstdc++-v3/include/parallel/algo.h | 5 +++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 45ad8517bf40..9cf1c9a52c44 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,10 @@ 2019-10-01 Jonathan Wakely + * include/experimental/algorithm (experimental::sample): Qualify call + to __sample correctly. + * include/parallel/algo.h (sample, for_each_n): Add using-declarations + for algorithms that don't have parallel implementations. + * include/parallel/algobase.h (equal, lexicographical_compare): Add _GLIBCXX20_CONSTEXPR and dispatch to sequential algorithm when being constant evaluated. diff --git a/libstdc++-v3/include/experimental/algorithm b/libstdc++-v3/include/experimental/algorithm index 8ba212c5132f..f036a713ef38 100644 --- a/libstdc++-v3/include/experimental/algorithm +++ b/libstdc++-v3/include/experimental/algorithm @@ -77,9 +77,9 @@ inline namespace fundamentals_v2 "sample size must be an integer type"); typename iterator_traits<_PopulationIterator>::difference_type __d = __n; - return std::__sample(__first, __last, __pop_cat{}, __out, __samp_cat{}, - __d, - std::forward<_UniformRandomNumberGenerator>(__g)); + return _GLIBCXX_STD_A:: + __sample(__first, __last, __pop_cat{}, __out, __samp_cat{}, __d, + std::forward<_UniformRandomNumberGenerator>(__g)); } template= 201703L + using _GLIBCXX_STD_A::for_each_n; + using _GLIBCXX_STD_A::sample; +#endif } // end namespace } // end namespace -- 2.47.2