From a16bc2f317ddfeb45a6b293aec4d89afe0e79a72 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 1 Oct 2019 22:02:27 +0100 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. From-SVN: r276432 --- 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 45ad8517bf4..9cf1c9a52c4 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 8ba212c5132..f036a713ef3 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.30.2