35 #if defined(__cpp_lib_execution) && defined(__cpp_lib_parallel_algorithm) && !defined(NO_MULTITHREAD)
36 #define PARALLEL_ALGORITHMS_SUPPORTED
40 #define NO_EXCEPT noexcept
45 namespace stl_algorithms
56 template<
class InputIt,
class UnaryPredicate>
60 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
61 std::execution::par_unseq,
75 template<
class InputIt,
class UnaryPredicate>
79 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
80 std::execution::par_unseq,
94 template<
class InputIt,
class OutputIt>
95 OutputIt
copy(InputIt first, InputIt last, OutputIt destination)
NO_EXCEPT
98 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
99 std::execution::par_unseq,
101 first, last, destination);
113 template<
class InputIt,
class T>
114 typename std::iterator_traits<InputIt>::difference_type
118 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
119 std::execution::par_unseq,
134 template<
class InputIt1,
class InputIt2>
138 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
139 std::execution::par_unseq,
141 first1, last1, first2);
154 template<
class InputIt1,
class InputIt2,
class BinaryPredicate>
155 bool equal(InputIt1 first1, InputIt1 last1,
156 InputIt2 first2, BinaryPredicate p)
NO_EXCEPT
159 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
160 std::execution::par_unseq,
162 first1, last1, first2, p);
173 template<
class ForwardIt,
class T>
177 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
178 std::execution::par_unseq,
194 template<
class InputIt,
class T>
198 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
199 std::execution::par_unseq,
212 template<
class InputIt,
class UnaryFunction>
213 void for_each(InputIt first, InputIt last, UnaryFunction
f)
216 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
217 std::execution::par_unseq,
230 template<
class ForwardIt>
234 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
235 std::execution::par_unseq,
249 template<
class ForwardIt,
class Compare>
253 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
254 std::execution::par_unseq,
267 template<
class ForwardIt>
271 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
272 std::execution::par_unseq,
286 template<
class ForwardIt,
class Compare>
290 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
291 std::execution::par_unseq,
303 template<
class ForwardIt>
307 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
308 std::execution::par_unseq,
322 template<
class ForwardIt,
class Compare>
326 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
327 std::execution::par_unseq,
340 template<
class ForwardIt>
344 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
345 std::execution::par_unseq,
359 template<
class ForwardIt,
class Compare>
363 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
364 std::execution::par_unseq,
378 template<
class InputIt,
class UnaryPredicate>
382 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
383 std::execution::par_unseq,
396 template<
class RandomIt>
400 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
401 std::execution::par_unseq,
415 template<
class RandomIt,
class Compare>
419 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
420 std::execution::par_unseq,
422 first, nth, last, comp);
434 template<
class ForwardIt,
class T>
436 const T& oldValue,
const T& newValue)
NO_EXCEPT
439 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
440 std::execution::par_unseq,
442 first, last, oldValue, newValue);
452 template<
class B
idirIt>
456 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
457 std::execution::par_unseq,
470 template<
class ForwardIt>
474 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
475 std::execution::par_unseq,
477 first, firstN, last);
491 template<
class InputIt1,
class InputIt2,
class OutputIt>
493 InputIt2 first2, InputIt2 last2,
494 OutputIt destination)
497 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
498 std::execution::par_unseq,
500 first1, last1, first2, last2, destination);
515 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
517 InputIt2 first2, InputIt2 last2,
518 OutputIt destination, Compare comp)
NO_EXCEPT
521 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
522 std::execution::par_unseq,
524 first1, last1, first2, last2, destination, comp);
538 template<
class InputIt1,
class InputIt2,
class OutputIt>
540 InputIt2 first2, InputIt2 last2,
544 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
545 std::execution::par_unseq,
547 first1, last1, first2, last2, destination);
562 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
564 InputIt2 first2, InputIt2 last2,
565 OutputIt destination, Compare comp)
NO_EXCEPT
568 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
569 std::execution::par_unseq,
571 first1, last1, first2, last2, destination, comp);
585 template<
class InputIt1,
class InputIt2,
class OutputIt>
587 InputIt2 first2, InputIt2 last2,
591 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
592 std::execution::par_unseq,
594 first1, last1, first2, last2, destination);
609 template<
class InputIt1,
class InputIt2,
class OutputIt,
class Compare>
611 InputIt2 first2, InputIt2 last2,
612 OutputIt destination, Compare comp)
NO_EXCEPT
615 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
616 std::execution::par_unseq,
618 first1, last1, first2, last2, destination, comp);
628 template<
class RandomIt>
632 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
633 std::execution::par_unseq,
646 template<
class RandomIt,
class Compare>
650 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
651 std::execution::par_unseq,
663 template<
class RandomIt>
667 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
668 std::execution::par_unseq,
681 template<
class RandomIt,
class Compare>
685 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
686 std::execution::par_unseq,
701 template<
class InputIt,
class OutputIt,
class UnaryOperation>
702 OutputIt
transform(InputIt first, InputIt last, OutputIt destination,
703 UnaryOperation unaryFunction)
706 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
707 std::execution::par_unseq,
709 first, last, destination, unaryFunction);
723 template<
class InputIt1,
class InputIt2,
class OutputIt,
class BinaryOperation>
724 OutputIt
transform(InputIt1 first1, InputIt1 last1, InputIt2 first2,
725 OutputIt destination, BinaryOperation unaryFunction)
728 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
729 std::execution::par_unseq,
731 first1, last1, first2, destination, unaryFunction);
743 template<
class InputIt,
class OutputIt>
748 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
749 std::execution::par_unseq,
751 first, last, destination);
764 template<
class InputIt,
class OutputIt,
class BinaryPredicate>
766 OutputIt destination, BinaryPredicate binaryFunction)
NO_EXCEPT
769 #ifdef PARALLEL_ALGORITHMS_SUPPORTED
770 std::execution::par_unseq,
772 first, last, destination, binaryFunction);