Commit a16bc2f3 by Jonathan Wakely Committed by Jonathan Wakely

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
parent e12097ed
2019-10-01 Jonathan Wakely <jwakely@redhat.com>
* 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.
......
......@@ -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<typename _PopulationIterator, typename _SampleIterator,
......
......@@ -2189,6 +2189,11 @@ namespace __parallel
return __min_element_switch(__begin, __end, __comp,
std::__iterator_category(__begin));
}
#if __cplusplus >= 201703L
using _GLIBCXX_STD_A::for_each_n;
using _GLIBCXX_STD_A::sample;
#endif
} // end namespace
} // end namespace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment