36 #if defined(__cpp_lib_execution) && defined(__cpp_lib_parallel_algorithm)
37 #define PARALLEL_ALGORITHMS_SUPPORTED
41 #define NO_EXCEPT noexcept
46 namespace stl_algorithms
57 template<
class InputIt,
class UnaryPredicate>
61 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
62 std::execution::par_unseq,
76 template<
class InputIt,
class UnaryPredicate>
80 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
81 std::execution::par_unseq,
95 template<
class InputIt,
class OutputIt>
96 OutputIt
copy(InputIt first, InputIt last, OutputIt destination)
NO_EXCEPT
99 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
100 std::execution::par_unseq,
102 first, last, destination);
114 template<
class InputIt,
class T>
115 typename std::iterator_traits<InputIt>::difference_type
119 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
120 std::execution::par_unseq,
135 template<
class InputIt1,
class InputIt2>
139 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
140 std::execution::par_unseq,
142 first1, last1, first2);
155 template<
class InputIt1,
class InputIt2,
class BinaryPredicate>
156 bool equal(InputIt1 first1, InputIt1 last1,
157 InputIt2 first2, BinaryPredicate p)
NO_EXCEPT
160 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
161 std::execution::par_unseq,
163 first1, last1, first2, p);
174 template<
class ForwardIt,
class T>
178 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
179 std::execution::par_unseq,
195 template<
class InputIt,
class T>
199 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
200 std::execution::par_unseq,
213 template<
class InputIt,
class UnaryFunction>
217 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
218 std::execution::par_unseq,
231 template<
class ForwardIt>
235 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
236 std::execution::par_unseq,
250 template<
class ForwardIt,
class Compare>
254 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
255 std::execution::par_unseq,
268 template<
class ForwardIt>
272 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
273 std::execution::par_unseq,
287 template<
class ForwardIt,
class Compare>
291 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
292 std::execution::par_unseq,
304 template<
class ForwardIt>
308 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
309 std::execution::par_unseq,
323 template<
class ForwardIt,
class Compare>
327 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
328 std::execution::par_unseq,
341 template<
class ForwardIt>
345 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
346 std::execution::par_unseq,
360 template<
class ForwardIt,
class Compare>
364 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
365 std::execution::par_unseq,
379 template<
class InputIt,
class UnaryPredicate>
383 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
384 std::execution::par_unseq,
397 template<
class RandomIt>
401 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
402 std::execution::par_unseq,
416 template<
class RandomIt,
class Compare>
420 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
421 std::execution::par_unseq,
423 first, nth, last, comp);
435 template<
class ForwardIt,
class T>
437 const T& oldValue,
const T& newValue)
NO_EXCEPT
440 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
441 std::execution::par_unseq,
443 first, last, oldValue, newValue);
453 template<
class B
idirIt>
457 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
458 std::execution::par_unseq,
471 template<
class ForwardIt>
475 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
476 std::execution::par_unseq,
478 first, firstN, last);
492 template<
class InputIt1,
class InputIt2,
class OutputIt>
494 InputIt2 first2, InputIt2 last2,
495 OutputIt destination)
498 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
499 std::execution::par_unseq,
501 first1, last1, first2, last2, destination);
516 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
518 InputIt2 first2, InputIt2 last2,
519 OutputIt destination, Compare comp)
NO_EXCEPT
522 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
523 std::execution::par_unseq,
525 first1, last1, first2, last2, destination, comp);
539 template<
class InputIt1,
class InputIt2,
class OutputIt>
541 InputIt2 first2, InputIt2 last2,
545 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
546 std::execution::par_unseq,
548 first1, last1, first2, last2, destination);
563 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
565 InputIt2 first2, InputIt2 last2,
566 OutputIt destination, Compare comp)
NO_EXCEPT
569 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
570 std::execution::par_unseq,
572 first1, last1, first2, last2, destination, comp);
586 template<
class InputIt1,
class InputIt2,
class OutputIt>
588 InputIt2 first2, InputIt2 last2,
592 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
593 std::execution::par_unseq,
595 first1, last1, first2, last2, destination);
610 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
612 InputIt2 first2, InputIt2 last2,
613 OutputIt destination, Compare comp)
NO_EXCEPT
616 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
617 std::execution::par_unseq,
619 first1, last1, first2, last2, destination, comp);
629 template<
class RandomIt>
633 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
634 std::execution::par_unseq,
647 template<
class RandomIt,
class Compare>
651 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
652 std::execution::par_unseq,
664 template<
class RandomIt>
668 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
669 std::execution::par_unseq,
682 template<
class RandomIt,
class Compare>
686 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
687 std::execution::par_unseq,
702 template<
class InputIt,
class OutputIt,
class UnaryOperation>
703 OutputIt
transform(InputIt first, InputIt last, OutputIt destination,
707 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
708 std::execution::par_unseq,
710 first, last, destination, unaryFunction);
724 template<
class InputIt1,
class InputIt2,
class OutputIt,
class BinaryOperation>
725 OutputIt
transform(InputIt1 first1, InputIt1 last1, InputIt2 first2,
726 OutputIt destination, BinaryOperation unaryFunction)
NO_EXCEPT
729 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
730 std::execution::par_unseq,
732 first1, last1, first2, destination, unaryFunction);
744 template<
class InputIt,
class OutputIt>
749 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
750 std::execution::par_unseq,
752 first, last, destination);
765 template<
class InputIt,
class OutputIt,
class BinaryPredicate>
767 OutputIt destination, BinaryPredicate binaryFunction)
NO_EXCEPT
770 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
771 std::execution::par_unseq,
773 first, last, destination, binaryFunction);