From: Jonathan Wakely Date: Tue, 1 Oct 2019 21:02:27 +0000 (+0100) Subject: Make some new algorithms work in parallel mode X-Git-Tag: misc/cutover-git~2353 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a16bc2f317ddfeb45a6b293aec4d89afe0e79a72;p=thirdparty%2Fgcc.git 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 --- 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