Initial PSTL commit
[lldb.git] / pstl / include / pstl / internal / glue_algorithm_defs.h
1 // -*- C++ -*-
2 //===-- glue_algorithm_defs.h ---------------------------------------------===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10
11 #ifndef __PSTL_glue_algorithm_defs_H
12 #define __PSTL_glue_algorithm_defs_H
13
14 #include <functional>
15
16 #include "execution_defs.h"
17
18 namespace std
19 {
20
21 // [alg.any_of]
22
23 template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
24 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
25 any_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
26
27 // [alg.all_of]
28
29 template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
30 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
31 all_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
32
33 // [alg.none_of]
34
35 template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
36 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
37 none_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
38
39 // [alg.foreach]
40
41 template <class _ExecutionPolicy, class _ForwardIterator, class _Function>
42 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
43 for_each(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Function __f);
44
45 template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Function>
46 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
47 for_each_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __n, _Function __f);
48
49 // [alg.find]
50
51 template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
52 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
53 find_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
54
55 template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
56 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
57 find_if_not(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
58
59 template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
60 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
61 find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
62
63 // [alg.find.end]
64
65 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
66 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
67 find_end(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
68          _ForwardIterator2 __s_last, _BinaryPredicate __pred);
69
70 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
71 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
72 find_end(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
73          _ForwardIterator2 __s_last);
74
75 // [alg.find_first_of]
76
77 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
78 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
79 find_first_of(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
80               _ForwardIterator2 __s_first, _ForwardIterator2 __s_last, _BinaryPredicate __pred);
81
82 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
83 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
84 find_first_of(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
85               _ForwardIterator2 __s_first, _ForwardIterator2 __s_last);
86
87 // [alg.adjacent_find]
88
89 template <class _ExecutionPolicy, class _ForwardIterator>
90 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
91 adjacent_find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
92
93 template <class _ExecutionPolicy, class _ForwardIterator, class _BinaryPredicate>
94 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
95 adjacent_find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred);
96
97 // [alg.count]
98
99 template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
100 pstl::internal::enable_if_execution_policy<_ExecutionPolicy,
101                                            typename iterator_traits<_ForwardIterator>::difference_type>
102 count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
103
104 template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate>
105 pstl::internal::enable_if_execution_policy<_ExecutionPolicy,
106                                            typename iterator_traits<_ForwardIterator>::difference_type>
107 count_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
108
109 // [alg.search]
110
111 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
112 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
113 search(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
114        _ForwardIterator2 __s_last, _BinaryPredicate __pred);
115
116 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
117 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator1>
118 search(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
119        _ForwardIterator2 __s_last);
120
121 template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate>
122 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
123 search_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Size __count,
124          const _Tp& __value, _BinaryPredicate __pred);
125
126 template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp>
127 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
128 search_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Size __count,
129          const _Tp& __value);
130
131 // [alg.copy]
132
133 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
134 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
135 copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result);
136
137 template <class _ExecutionPolicy, class _ForwardIterator1, class _Size, class _ForwardIterator2>
138 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
139 copy_n(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _Size __n, _ForwardIterator2 __result);
140
141 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
142 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
143 copy_if(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 result,
144         _Predicate __pred);
145
146 // [alg.swap]
147
148 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
149 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
150 swap_ranges(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
151             _ForwardIterator2 __first2);
152
153 // [alg.transform]
154
155 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation>
156 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
157 transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
158           _UnaryOperation __op);
159
160 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
161           class _BinaryOperation>
162 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
163 transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
164           _ForwardIterator __result, _BinaryOperation __op);
165
166 // [alg.replace]
167
168 template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate, class _Tp>
169 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
170 replace_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred,
171            const _Tp& __new_value);
172
173 template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
174 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
175 replace(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value,
176         const _Tp& __new_value);
177
178 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryPredicate, class _Tp>
179 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
180 replace_copy_if(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
181                 _ForwardIterator2 __result, _UnaryPredicate __pred, const _Tp& __new_value);
182
183 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
184 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
185 replace_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
186              const _Tp& __old_value, const _Tp& __new_value);
187
188 // [alg.fill]
189
190 template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
191 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
192 fill(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
193
194 template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp>
195 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
196 fill_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __count, const _Tp& __value);
197
198 // [alg.generate]
199 template <class _ExecutionPolicy, class _ForwardIterator, class _Generator>
200 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
201 generate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Generator __g);
202
203 template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Generator>
204 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
205 generate_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size count, _Generator __g);
206
207 // [alg.remove]
208
209 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
210 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
211 remove_copy_if(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
212                _ForwardIterator2 __result, _Predicate __pred);
213
214 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
215 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
216 remove_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
217             const _Tp& __value);
218
219 template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate>
220 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
221 remove_if(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred);
222
223 template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
224 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
225 remove(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
226
227 // [alg.unique]
228
229 template <class _ExecutionPolicy, class _ForwardIterator, class _BinaryPredicate>
230 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
231 unique(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred);
232
233 template <class _ExecutionPolicy, class _ForwardIterator>
234 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
235 unique(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
236
237 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
238 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
239 unique_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
240             _BinaryPredicate __pred);
241
242 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
243 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
244 unique_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result);
245
246 // [alg.reverse]
247
248 template <class _ExecutionPolicy, class _BidirectionalIterator>
249 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
250 reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last);
251
252 template <class _ExecutionPolicy, class _BidirectionalIterator, class _ForwardIterator>
253 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
254 reverse_copy(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last,
255              _ForwardIterator __d_first);
256
257 // [alg.rotate]
258
259 template <class _ExecutionPolicy, class _ForwardIterator>
260 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
261 rotate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last);
262
263 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
264 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
265 rotate_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __middle, _ForwardIterator1 __last,
266             _ForwardIterator2 __result);
267
268 // [alg.partitions]
269
270 template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate>
271 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
272 is_partitioned(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred);
273
274 template <class _ExecutionPolicy, class _ForwardIterator, class _UnaryPredicate>
275 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
276 partition(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _UnaryPredicate __pred);
277
278 template <class _ExecutionPolicy, class _BidirectionalIterator, class _UnaryPredicate>
279 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _BidirectionalIterator>
280 stable_partition(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last,
281                  _UnaryPredicate __pred);
282
283 template <class _ExecutionPolicy, class _ForwardIterator, class _ForwardIterator1, class _ForwardIterator2,
284           class _UnaryPredicate>
285 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
286 partition_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
287                _ForwardIterator1 __out_true, _ForwardIterator2 __out_false, _UnaryPredicate __pred);
288
289 // [alg.sort]
290
291 template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
292 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
293 sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
294
295 template <class _ExecutionPolicy, class _RandomAccessIterator>
296 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
297 sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
298
299 // [stable.sort]
300
301 template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
302 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
303 stable_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
304
305 template <class _ExecutionPolicy, class _RandomAccessIterator>
306 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
307 stable_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
308
309 // [mismatch]
310
311 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
312 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
313 mismatch(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
314          _ForwardIterator2 __last2, _BinaryPredicate __pred);
315
316 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
317 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
318 mismatch(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
319          _BinaryPredicate __pred);
320
321 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
322 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
323 mismatch(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
324          _ForwardIterator2 __last2);
325
326 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
327 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator1, _ForwardIterator2>>
328 mismatch(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2);
329
330 // [alg.equal]
331
332 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
333 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
334 equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
335       _BinaryPredicate __p);
336
337 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
338 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
339 equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2);
340
341 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
342 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
343 equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
344       _ForwardIterator2 __last2, _BinaryPredicate __p);
345
346 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
347 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
348 equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
349       _ForwardIterator2 __last2);
350
351 // [alg.move]
352 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
353 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
354 move(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __d_first);
355
356 // [partial.sort]
357
358 template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
359 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
360 partial_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __middle,
361              _RandomAccessIterator __last, _Compare __comp);
362
363 template <class _ExecutionPolicy, class _RandomAccessIterator>
364 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
365 partial_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __middle,
366              _RandomAccessIterator __last);
367
368 // [partial.sort.copy]
369
370 template <class _ExecutionPolicy, class _ForwardIterator, class _RandomAccessIterator, class _Compare>
371 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
372 partial_sort_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
373                   _RandomAccessIterator __d_first, _RandomAccessIterator __d_last, _Compare __comp);
374
375 template <class _ExecutionPolicy, class _ForwardIterator, class _RandomAccessIterator>
376 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
377 partial_sort_copy(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last,
378                   _RandomAccessIterator __d_first, _RandomAccessIterator __d_last);
379
380 // [is.sorted]
381 template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
382 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
383 is_sorted_until(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp);
384
385 template <class _ExecutionPolicy, class _ForwardIterator>
386 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
387 is_sorted_until(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
388
389 template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
390 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
391 is_sorted(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp);
392
393 template <class _ExecutionPolicy, class _ForwardIterator>
394 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
395 is_sorted(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
396
397 // [alg.nth.element]
398
399 template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
400 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
401 nth_element(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __nth,
402             _RandomAccessIterator __last, _Compare __comp);
403
404 template <class _ExecutionPolicy, class _RandomAccessIterator>
405 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
406 nth_element(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __nth,
407             _RandomAccessIterator __last);
408
409 // [alg.merge]
410 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
411           class _Compare>
412 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
413 merge(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
414       _ForwardIterator2 __last2, _ForwardIterator __d_first, _Compare __comp);
415
416 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
417 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
418 merge(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
419       _ForwardIterator2 __last2, _ForwardIterator __d_first);
420
421 template <class _ExecutionPolicy, class _BidirectionalIterator, class _Compare>
422 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
423 inplace_merge(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __middle,
424               _BidirectionalIterator __last, _Compare __comp);
425
426 template <class _ExecutionPolicy, class _BidirectionalIterator>
427 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, void>
428 inplace_merge(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __middle,
429               _BidirectionalIterator __last);
430
431 // [includes]
432
433 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare>
434 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
435 includes(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
436          _ForwardIterator2 __last2, _Compare __comp);
437
438 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
439 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
440 includes(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
441          _ForwardIterator2 __last2);
442
443 // [set.union]
444
445 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
446           class _Compare>
447 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
448 set_union(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
449           _ForwardIterator2 __last2, _ForwardIterator __result, _Compare __comp);
450
451 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
452 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
453 set_union(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
454           _ForwardIterator2 __last2, _ForwardIterator __result);
455
456 // [set.intersection]
457
458 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
459           class _Compare>
460 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
461 set_intersection(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
462                  _ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result, _Compare __comp);
463
464 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
465 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
466 set_intersection(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
467                  _ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result);
468
469 // [set.difference]
470
471 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
472           class _Compare>
473 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
474 set_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
475                _ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result, _Compare __comp);
476
477 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
478 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
479 set_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
480                _ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result);
481
482 // [set.symmetric.difference]
483
484 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator,
485           class _Compare>
486 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
487 set_symmetric_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
488                          _ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator result,
489                          _Compare __comp);
490
491 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator>
492 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
493 set_symmetric_difference(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
494                          _ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result);
495
496 // [is.heap]
497 template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
498 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
499 is_heap_until(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
500
501 template <class _ExecutionPolicy, class _RandomAccessIterator>
502 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _RandomAccessIterator>
503 is_heap_until(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
504
505 template <class _ExecutionPolicy, class _RandomAccessIterator, class _Compare>
506 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
507 is_heap(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
508
509 template <class _ExecutionPolicy, class _RandomAccessIterator>
510 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
511 is_heap(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
512
513 // [alg.min.max]
514
515 template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
516 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
517 min_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp);
518
519 template <class _ExecutionPolicy, class _ForwardIterator>
520 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
521 min_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
522
523 template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
524 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
525 max_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp);
526
527 template <class _ExecutionPolicy, class _ForwardIterator>
528 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
529 max_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
530
531 template <class _ExecutionPolicy, class _ForwardIterator, class _Compare>
532 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator, _ForwardIterator>>
533 minmax_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp);
534
535 template <class _ExecutionPolicy, class _ForwardIterator>
536 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, std::pair<_ForwardIterator, _ForwardIterator>>
537 minmax_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
538
539 // [alg.lex.comparison]
540
541 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Compare>
542 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
543 lexicographical_compare(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
544                         _ForwardIterator2 __first2, _ForwardIterator2 __last2, _Compare __comp);
545
546 template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
547 pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
548 lexicographical_compare(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
549                         _ForwardIterator2 __first2, _ForwardIterator2 __last2);
550
551 } // namespace std
552 #endif /* __PSTL_glue_algorithm_defs_H */