You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

968 lines
24KB

  1. // <algorithm> Forward declarations -*- C++ -*-
  2. // Copyright (C) 2007-2020 Free Software Foundation, Inc.
  3. //
  4. // This file is part of the GNU ISO C++ Library. This library is free
  5. // software; you can redistribute it and/or modify it under the
  6. // terms of the GNU General Public License as published by the
  7. // Free Software Foundation; either version 3, or (at your option)
  8. // any later version.
  9. // This library is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. // Under Section 7 of GPL version 3, you are granted additional
  14. // permissions described in the GCC Runtime Library Exception, version
  15. // 3.1, as published by the Free Software Foundation.
  16. // You should have received a copy of the GNU General Public License and
  17. // a copy of the GCC Runtime Library Exception along with this program;
  18. // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. // <http://www.gnu.org/licenses/>.
  20. /** @file bits/algorithmfwd.h
  21. * This is an internal header file, included by other library headers.
  22. * Do not attempt to use it directly. @headername{algorithm}
  23. */
  24. #ifndef _GLIBCXX_ALGORITHMFWD_H
  25. #define _GLIBCXX_ALGORITHMFWD_H 1
  26. #pragma GCC system_header
  27. #include <bits/c++config.h>
  28. #include <bits/stl_pair.h>
  29. #include <bits/stl_iterator_base_types.h>
  30. #if __cplusplus >= 201103L
  31. #include <initializer_list>
  32. #endif
  33. namespace std _GLIBCXX_VISIBILITY(default)
  34. {
  35. _GLIBCXX_BEGIN_NAMESPACE_VERSION
  36. /*
  37. adjacent_find
  38. all_of (C++11)
  39. any_of (C++11)
  40. binary_search
  41. clamp (C++17)
  42. copy
  43. copy_backward
  44. copy_if (C++11)
  45. copy_n (C++11)
  46. count
  47. count_if
  48. equal
  49. equal_range
  50. fill
  51. fill_n
  52. find
  53. find_end
  54. find_first_of
  55. find_if
  56. find_if_not (C++11)
  57. for_each
  58. generate
  59. generate_n
  60. includes
  61. inplace_merge
  62. is_heap (C++11)
  63. is_heap_until (C++11)
  64. is_partitioned (C++11)
  65. is_sorted (C++11)
  66. is_sorted_until (C++11)
  67. iter_swap
  68. lexicographical_compare
  69. lower_bound
  70. make_heap
  71. max
  72. max_element
  73. merge
  74. min
  75. min_element
  76. minmax (C++11)
  77. minmax_element (C++11)
  78. mismatch
  79. next_permutation
  80. none_of (C++11)
  81. nth_element
  82. partial_sort
  83. partial_sort_copy
  84. partition
  85. partition_copy (C++11)
  86. partition_point (C++11)
  87. pop_heap
  88. prev_permutation
  89. push_heap
  90. random_shuffle
  91. remove
  92. remove_copy
  93. remove_copy_if
  94. remove_if
  95. replace
  96. replace_copy
  97. replace_copy_if
  98. replace_if
  99. reverse
  100. reverse_copy
  101. rotate
  102. rotate_copy
  103. search
  104. search_n
  105. set_difference
  106. set_intersection
  107. set_symmetric_difference
  108. set_union
  109. shuffle (C++11)
  110. sort
  111. sort_heap
  112. stable_partition
  113. stable_sort
  114. swap
  115. swap_ranges
  116. transform
  117. unique
  118. unique_copy
  119. upper_bound
  120. */
  121. /**
  122. * @defgroup algorithms Algorithms
  123. *
  124. * Components for performing algorithmic operations. Includes
  125. * non-modifying sequence, modifying (mutating) sequence, sorting,
  126. * searching, merge, partition, heap, set, minima, maxima, and
  127. * permutation operations.
  128. */
  129. /**
  130. * @defgroup mutating_algorithms Mutating
  131. * @ingroup algorithms
  132. */
  133. /**
  134. * @defgroup non_mutating_algorithms Non-Mutating
  135. * @ingroup algorithms
  136. */
  137. /**
  138. * @defgroup sorting_algorithms Sorting
  139. * @ingroup algorithms
  140. */
  141. /**
  142. * @defgroup set_algorithms Set Operations
  143. * @ingroup sorting_algorithms
  144. *
  145. * These algorithms are common set operations performed on sequences
  146. * that are already sorted. The number of comparisons will be
  147. * linear.
  148. */
  149. /**
  150. * @defgroup binary_search_algorithms Binary Search
  151. * @ingroup sorting_algorithms
  152. *
  153. * These algorithms are variations of a classic binary search, and
  154. * all assume that the sequence being searched is already sorted.
  155. *
  156. * The number of comparisons will be logarithmic (and as few as
  157. * possible). The number of steps through the sequence will be
  158. * logarithmic for random-access iterators (e.g., pointers), and
  159. * linear otherwise.
  160. *
  161. * The LWG has passed Defect Report 270, which notes: <em>The
  162. * proposed resolution reinterprets binary search. Instead of
  163. * thinking about searching for a value in a sorted range, we view
  164. * that as an important special case of a more general algorithm:
  165. * searching for the partition point in a partitioned range. We
  166. * also add a guarantee that the old wording did not: we ensure that
  167. * the upper bound is no earlier than the lower bound, that the pair
  168. * returned by equal_range is a valid range, and that the first part
  169. * of that pair is the lower bound.</em>
  170. *
  171. * The actual effect of the first sentence is that a comparison
  172. * functor passed by the user doesn't necessarily need to induce a
  173. * strict weak ordering relation. Rather, it partitions the range.
  174. */
  175. // adjacent_find
  176. #if __cplusplus > 201703L
  177. # define __cpp_lib_constexpr_algorithms 201806L
  178. #endif
  179. #if __cplusplus >= 201103L
  180. template<typename _IIter, typename _Predicate>
  181. _GLIBCXX20_CONSTEXPR
  182. bool
  183. all_of(_IIter, _IIter, _Predicate);
  184. template<typename _IIter, typename _Predicate>
  185. _GLIBCXX20_CONSTEXPR
  186. bool
  187. any_of(_IIter, _IIter, _Predicate);
  188. #endif
  189. template<typename _FIter, typename _Tp>
  190. _GLIBCXX20_CONSTEXPR
  191. bool
  192. binary_search(_FIter, _FIter, const _Tp&);
  193. template<typename _FIter, typename _Tp, typename _Compare>
  194. _GLIBCXX20_CONSTEXPR
  195. bool
  196. binary_search(_FIter, _FIter, const _Tp&, _Compare);
  197. #if __cplusplus > 201402L
  198. template<typename _Tp>
  199. _GLIBCXX14_CONSTEXPR
  200. const _Tp&
  201. clamp(const _Tp&, const _Tp&, const _Tp&);
  202. template<typename _Tp, typename _Compare>
  203. _GLIBCXX14_CONSTEXPR
  204. const _Tp&
  205. clamp(const _Tp&, const _Tp&, const _Tp&, _Compare);
  206. #endif
  207. template<typename _IIter, typename _OIter>
  208. _GLIBCXX20_CONSTEXPR
  209. _OIter
  210. copy(_IIter, _IIter, _OIter);
  211. template<typename _BIter1, typename _BIter2>
  212. _GLIBCXX20_CONSTEXPR
  213. _BIter2
  214. copy_backward(_BIter1, _BIter1, _BIter2);
  215. #if __cplusplus >= 201103L
  216. template<typename _IIter, typename _OIter, typename _Predicate>
  217. _GLIBCXX20_CONSTEXPR
  218. _OIter
  219. copy_if(_IIter, _IIter, _OIter, _Predicate);
  220. template<typename _IIter, typename _Size, typename _OIter>
  221. _GLIBCXX20_CONSTEXPR
  222. _OIter
  223. copy_n(_IIter, _Size, _OIter);
  224. #endif
  225. // count
  226. // count_if
  227. template<typename _FIter, typename _Tp>
  228. _GLIBCXX20_CONSTEXPR
  229. pair<_FIter, _FIter>
  230. equal_range(_FIter, _FIter, const _Tp&);
  231. template<typename _FIter, typename _Tp, typename _Compare>
  232. _GLIBCXX20_CONSTEXPR
  233. pair<_FIter, _FIter>
  234. equal_range(_FIter, _FIter, const _Tp&, _Compare);
  235. template<typename _FIter, typename _Tp>
  236. _GLIBCXX20_CONSTEXPR
  237. void
  238. fill(_FIter, _FIter, const _Tp&);
  239. template<typename _OIter, typename _Size, typename _Tp>
  240. _GLIBCXX20_CONSTEXPR
  241. _OIter
  242. fill_n(_OIter, _Size, const _Tp&);
  243. // find
  244. template<typename _FIter1, typename _FIter2>
  245. _GLIBCXX20_CONSTEXPR
  246. _FIter1
  247. find_end(_FIter1, _FIter1, _FIter2, _FIter2);
  248. template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
  249. _GLIBCXX20_CONSTEXPR
  250. _FIter1
  251. find_end(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
  252. // find_first_of
  253. // find_if
  254. #if __cplusplus >= 201103L
  255. template<typename _IIter, typename _Predicate>
  256. _GLIBCXX20_CONSTEXPR
  257. _IIter
  258. find_if_not(_IIter, _IIter, _Predicate);
  259. #endif
  260. // for_each
  261. // generate
  262. // generate_n
  263. template<typename _IIter1, typename _IIter2>
  264. _GLIBCXX20_CONSTEXPR
  265. bool
  266. includes(_IIter1, _IIter1, _IIter2, _IIter2);
  267. template<typename _IIter1, typename _IIter2, typename _Compare>
  268. _GLIBCXX20_CONSTEXPR
  269. bool
  270. includes(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
  271. template<typename _BIter>
  272. void
  273. inplace_merge(_BIter, _BIter, _BIter);
  274. template<typename _BIter, typename _Compare>
  275. void
  276. inplace_merge(_BIter, _BIter, _BIter, _Compare);
  277. #if __cplusplus >= 201103L
  278. template<typename _RAIter>
  279. _GLIBCXX20_CONSTEXPR
  280. bool
  281. is_heap(_RAIter, _RAIter);
  282. template<typename _RAIter, typename _Compare>
  283. _GLIBCXX20_CONSTEXPR
  284. bool
  285. is_heap(_RAIter, _RAIter, _Compare);
  286. template<typename _RAIter>
  287. _GLIBCXX20_CONSTEXPR
  288. _RAIter
  289. is_heap_until(_RAIter, _RAIter);
  290. template<typename _RAIter, typename _Compare>
  291. _GLIBCXX20_CONSTEXPR
  292. _RAIter
  293. is_heap_until(_RAIter, _RAIter, _Compare);
  294. template<typename _IIter, typename _Predicate>
  295. _GLIBCXX20_CONSTEXPR
  296. bool
  297. is_partitioned(_IIter, _IIter, _Predicate);
  298. template<typename _FIter1, typename _FIter2>
  299. _GLIBCXX20_CONSTEXPR
  300. bool
  301. is_permutation(_FIter1, _FIter1, _FIter2);
  302. template<typename _FIter1, typename _FIter2,
  303. typename _BinaryPredicate>
  304. _GLIBCXX20_CONSTEXPR
  305. bool
  306. is_permutation(_FIter1, _FIter1, _FIter2, _BinaryPredicate);
  307. template<typename _FIter>
  308. _GLIBCXX20_CONSTEXPR
  309. bool
  310. is_sorted(_FIter, _FIter);
  311. template<typename _FIter, typename _Compare>
  312. _GLIBCXX20_CONSTEXPR
  313. bool
  314. is_sorted(_FIter, _FIter, _Compare);
  315. template<typename _FIter>
  316. _GLIBCXX20_CONSTEXPR
  317. _FIter
  318. is_sorted_until(_FIter, _FIter);
  319. template<typename _FIter, typename _Compare>
  320. _GLIBCXX20_CONSTEXPR
  321. _FIter
  322. is_sorted_until(_FIter, _FIter, _Compare);
  323. #endif
  324. template<typename _FIter1, typename _FIter2>
  325. _GLIBCXX20_CONSTEXPR
  326. void
  327. iter_swap(_FIter1, _FIter2);
  328. template<typename _FIter, typename _Tp>
  329. _GLIBCXX20_CONSTEXPR
  330. _FIter
  331. lower_bound(_FIter, _FIter, const _Tp&);
  332. template<typename _FIter, typename _Tp, typename _Compare>
  333. _GLIBCXX20_CONSTEXPR
  334. _FIter
  335. lower_bound(_FIter, _FIter, const _Tp&, _Compare);
  336. template<typename _RAIter>
  337. _GLIBCXX20_CONSTEXPR
  338. void
  339. make_heap(_RAIter, _RAIter);
  340. template<typename _RAIter, typename _Compare>
  341. _GLIBCXX20_CONSTEXPR
  342. void
  343. make_heap(_RAIter, _RAIter, _Compare);
  344. template<typename _Tp>
  345. _GLIBCXX14_CONSTEXPR
  346. const _Tp&
  347. max(const _Tp&, const _Tp&);
  348. template<typename _Tp, typename _Compare>
  349. _GLIBCXX14_CONSTEXPR
  350. const _Tp&
  351. max(const _Tp&, const _Tp&, _Compare);
  352. // max_element
  353. // merge
  354. template<typename _Tp>
  355. _GLIBCXX14_CONSTEXPR
  356. const _Tp&
  357. min(const _Tp&, const _Tp&);
  358. template<typename _Tp, typename _Compare>
  359. _GLIBCXX14_CONSTEXPR
  360. const _Tp&
  361. min(const _Tp&, const _Tp&, _Compare);
  362. // min_element
  363. #if __cplusplus >= 201103L
  364. template<typename _Tp>
  365. _GLIBCXX14_CONSTEXPR
  366. pair<const _Tp&, const _Tp&>
  367. minmax(const _Tp&, const _Tp&);
  368. template<typename _Tp, typename _Compare>
  369. _GLIBCXX14_CONSTEXPR
  370. pair<const _Tp&, const _Tp&>
  371. minmax(const _Tp&, const _Tp&, _Compare);
  372. template<typename _FIter>
  373. _GLIBCXX14_CONSTEXPR
  374. pair<_FIter, _FIter>
  375. minmax_element(_FIter, _FIter);
  376. template<typename _FIter, typename _Compare>
  377. _GLIBCXX14_CONSTEXPR
  378. pair<_FIter, _FIter>
  379. minmax_element(_FIter, _FIter, _Compare);
  380. template<typename _Tp>
  381. _GLIBCXX14_CONSTEXPR
  382. _Tp
  383. min(initializer_list<_Tp>);
  384. template<typename _Tp, typename _Compare>
  385. _GLIBCXX14_CONSTEXPR
  386. _Tp
  387. min(initializer_list<_Tp>, _Compare);
  388. template<typename _Tp>
  389. _GLIBCXX14_CONSTEXPR
  390. _Tp
  391. max(initializer_list<_Tp>);
  392. template<typename _Tp, typename _Compare>
  393. _GLIBCXX14_CONSTEXPR
  394. _Tp
  395. max(initializer_list<_Tp>, _Compare);
  396. template<typename _Tp>
  397. _GLIBCXX14_CONSTEXPR
  398. pair<_Tp, _Tp>
  399. minmax(initializer_list<_Tp>);
  400. template<typename _Tp, typename _Compare>
  401. _GLIBCXX14_CONSTEXPR
  402. pair<_Tp, _Tp>
  403. minmax(initializer_list<_Tp>, _Compare);
  404. #endif
  405. // mismatch
  406. template<typename _BIter>
  407. _GLIBCXX20_CONSTEXPR
  408. bool
  409. next_permutation(_BIter, _BIter);
  410. template<typename _BIter, typename _Compare>
  411. _GLIBCXX20_CONSTEXPR
  412. bool
  413. next_permutation(_BIter, _BIter, _Compare);
  414. #if __cplusplus >= 201103L
  415. template<typename _IIter, typename _Predicate>
  416. _GLIBCXX20_CONSTEXPR
  417. bool
  418. none_of(_IIter, _IIter, _Predicate);
  419. #endif
  420. // nth_element
  421. // partial_sort
  422. template<typename _IIter, typename _RAIter>
  423. _GLIBCXX20_CONSTEXPR
  424. _RAIter
  425. partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter);
  426. template<typename _IIter, typename _RAIter, typename _Compare>
  427. _GLIBCXX20_CONSTEXPR
  428. _RAIter
  429. partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter, _Compare);
  430. // partition
  431. #if __cplusplus >= 201103L
  432. template<typename _IIter, typename _OIter1,
  433. typename _OIter2, typename _Predicate>
  434. _GLIBCXX20_CONSTEXPR
  435. pair<_OIter1, _OIter2>
  436. partition_copy(_IIter, _IIter, _OIter1, _OIter2, _Predicate);
  437. template<typename _FIter, typename _Predicate>
  438. _GLIBCXX20_CONSTEXPR
  439. _FIter
  440. partition_point(_FIter, _FIter, _Predicate);
  441. #endif
  442. template<typename _RAIter>
  443. _GLIBCXX20_CONSTEXPR
  444. void
  445. pop_heap(_RAIter, _RAIter);
  446. template<typename _RAIter, typename _Compare>
  447. _GLIBCXX20_CONSTEXPR
  448. void
  449. pop_heap(_RAIter, _RAIter, _Compare);
  450. template<typename _BIter>
  451. _GLIBCXX20_CONSTEXPR
  452. bool
  453. prev_permutation(_BIter, _BIter);
  454. template<typename _BIter, typename _Compare>
  455. _GLIBCXX20_CONSTEXPR
  456. bool
  457. prev_permutation(_BIter, _BIter, _Compare);
  458. template<typename _RAIter>
  459. _GLIBCXX20_CONSTEXPR
  460. void
  461. push_heap(_RAIter, _RAIter);
  462. template<typename _RAIter, typename _Compare>
  463. _GLIBCXX20_CONSTEXPR
  464. void
  465. push_heap(_RAIter, _RAIter, _Compare);
  466. // random_shuffle
  467. template<typename _FIter, typename _Tp>
  468. _GLIBCXX20_CONSTEXPR
  469. _FIter
  470. remove(_FIter, _FIter, const _Tp&);
  471. template<typename _FIter, typename _Predicate>
  472. _GLIBCXX20_CONSTEXPR
  473. _FIter
  474. remove_if(_FIter, _FIter, _Predicate);
  475. template<typename _IIter, typename _OIter, typename _Tp>
  476. _GLIBCXX20_CONSTEXPR
  477. _OIter
  478. remove_copy(_IIter, _IIter, _OIter, const _Tp&);
  479. template<typename _IIter, typename _OIter, typename _Predicate>
  480. _GLIBCXX20_CONSTEXPR
  481. _OIter
  482. remove_copy_if(_IIter, _IIter, _OIter, _Predicate);
  483. // replace
  484. template<typename _IIter, typename _OIter, typename _Tp>
  485. _GLIBCXX20_CONSTEXPR
  486. _OIter
  487. replace_copy(_IIter, _IIter, _OIter, const _Tp&, const _Tp&);
  488. template<typename _Iter, typename _OIter, typename _Predicate, typename _Tp>
  489. _GLIBCXX20_CONSTEXPR
  490. _OIter
  491. replace_copy_if(_Iter, _Iter, _OIter, _Predicate, const _Tp&);
  492. // replace_if
  493. template<typename _BIter>
  494. _GLIBCXX20_CONSTEXPR
  495. void
  496. reverse(_BIter, _BIter);
  497. template<typename _BIter, typename _OIter>
  498. _GLIBCXX20_CONSTEXPR
  499. _OIter
  500. reverse_copy(_BIter, _BIter, _OIter);
  501. inline namespace _V2
  502. {
  503. template<typename _FIter>
  504. _GLIBCXX20_CONSTEXPR
  505. _FIter
  506. rotate(_FIter, _FIter, _FIter);
  507. }
  508. template<typename _FIter, typename _OIter>
  509. _GLIBCXX20_CONSTEXPR
  510. _OIter
  511. rotate_copy(_FIter, _FIter, _FIter, _OIter);
  512. // search
  513. // search_n
  514. // set_difference
  515. // set_intersection
  516. // set_symmetric_difference
  517. // set_union
  518. #if (__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
  519. template<typename _RAIter, typename _UGenerator>
  520. void
  521. shuffle(_RAIter, _RAIter, _UGenerator&&);
  522. #endif
  523. template<typename _RAIter>
  524. _GLIBCXX20_CONSTEXPR
  525. void
  526. sort_heap(_RAIter, _RAIter);
  527. template<typename _RAIter, typename _Compare>
  528. _GLIBCXX20_CONSTEXPR
  529. void
  530. sort_heap(_RAIter, _RAIter, _Compare);
  531. template<typename _BIter, typename _Predicate>
  532. _BIter
  533. stable_partition(_BIter, _BIter, _Predicate);
  534. #if __cplusplus < 201103L
  535. // For C++11 swap() is declared in <type_traits>.
  536. template<typename _Tp, size_t _Nm>
  537. _GLIBCXX20_CONSTEXPR
  538. inline void
  539. swap(_Tp& __a, _Tp& __b);
  540. template<typename _Tp, size_t _Nm>
  541. _GLIBCXX20_CONSTEXPR
  542. inline void
  543. swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]);
  544. #endif
  545. template<typename _FIter1, typename _FIter2>
  546. _GLIBCXX20_CONSTEXPR
  547. _FIter2
  548. swap_ranges(_FIter1, _FIter1, _FIter2);
  549. // transform
  550. template<typename _FIter>
  551. _GLIBCXX20_CONSTEXPR
  552. _FIter
  553. unique(_FIter, _FIter);
  554. template<typename _FIter, typename _BinaryPredicate>
  555. _GLIBCXX20_CONSTEXPR
  556. _FIter
  557. unique(_FIter, _FIter, _BinaryPredicate);
  558. // unique_copy
  559. template<typename _FIter, typename _Tp>
  560. _GLIBCXX20_CONSTEXPR
  561. _FIter
  562. upper_bound(_FIter, _FIter, const _Tp&);
  563. template<typename _FIter, typename _Tp, typename _Compare>
  564. _GLIBCXX20_CONSTEXPR
  565. _FIter
  566. upper_bound(_FIter, _FIter, const _Tp&, _Compare);
  567. _GLIBCXX_BEGIN_NAMESPACE_ALGO
  568. template<typename _FIter>
  569. _GLIBCXX20_CONSTEXPR
  570. _FIter
  571. adjacent_find(_FIter, _FIter);
  572. template<typename _FIter, typename _BinaryPredicate>
  573. _GLIBCXX20_CONSTEXPR
  574. _FIter
  575. adjacent_find(_FIter, _FIter, _BinaryPredicate);
  576. template<typename _IIter, typename _Tp>
  577. _GLIBCXX20_CONSTEXPR
  578. typename iterator_traits<_IIter>::difference_type
  579. count(_IIter, _IIter, const _Tp&);
  580. template<typename _IIter, typename _Predicate>
  581. _GLIBCXX20_CONSTEXPR
  582. typename iterator_traits<_IIter>::difference_type
  583. count_if(_IIter, _IIter, _Predicate);
  584. template<typename _IIter1, typename _IIter2>
  585. _GLIBCXX20_CONSTEXPR
  586. bool
  587. equal(_IIter1, _IIter1, _IIter2);
  588. template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
  589. _GLIBCXX20_CONSTEXPR
  590. bool
  591. equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
  592. template<typename _IIter, typename _Tp>
  593. _GLIBCXX20_CONSTEXPR
  594. _IIter
  595. find(_IIter, _IIter, const _Tp&);
  596. template<typename _FIter1, typename _FIter2>
  597. _GLIBCXX20_CONSTEXPR
  598. _FIter1
  599. find_first_of(_FIter1, _FIter1, _FIter2, _FIter2);
  600. template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
  601. _GLIBCXX20_CONSTEXPR
  602. _FIter1
  603. find_first_of(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
  604. template<typename _IIter, typename _Predicate>
  605. _GLIBCXX20_CONSTEXPR
  606. _IIter
  607. find_if(_IIter, _IIter, _Predicate);
  608. template<typename _IIter, typename _Funct>
  609. _GLIBCXX20_CONSTEXPR
  610. _Funct
  611. for_each(_IIter, _IIter, _Funct);
  612. template<typename _FIter, typename _Generator>
  613. _GLIBCXX20_CONSTEXPR
  614. void
  615. generate(_FIter, _FIter, _Generator);
  616. template<typename _OIter, typename _Size, typename _Generator>
  617. _GLIBCXX20_CONSTEXPR
  618. _OIter
  619. generate_n(_OIter, _Size, _Generator);
  620. template<typename _IIter1, typename _IIter2>
  621. _GLIBCXX20_CONSTEXPR
  622. bool
  623. lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2);
  624. template<typename _IIter1, typename _IIter2, typename _Compare>
  625. _GLIBCXX20_CONSTEXPR
  626. bool
  627. lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
  628. template<typename _FIter>
  629. _GLIBCXX14_CONSTEXPR
  630. _FIter
  631. max_element(_FIter, _FIter);
  632. template<typename _FIter, typename _Compare>
  633. _GLIBCXX14_CONSTEXPR
  634. _FIter
  635. max_element(_FIter, _FIter, _Compare);
  636. template<typename _IIter1, typename _IIter2, typename _OIter>
  637. _GLIBCXX20_CONSTEXPR
  638. _OIter
  639. merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
  640. template<typename _IIter1, typename _IIter2, typename _OIter,
  641. typename _Compare>
  642. _GLIBCXX20_CONSTEXPR
  643. _OIter
  644. merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
  645. template<typename _FIter>
  646. _GLIBCXX14_CONSTEXPR
  647. _FIter
  648. min_element(_FIter, _FIter);
  649. template<typename _FIter, typename _Compare>
  650. _GLIBCXX14_CONSTEXPR
  651. _FIter
  652. min_element(_FIter, _FIter, _Compare);
  653. template<typename _IIter1, typename _IIter2>
  654. _GLIBCXX20_CONSTEXPR
  655. pair<_IIter1, _IIter2>
  656. mismatch(_IIter1, _IIter1, _IIter2);
  657. template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
  658. _GLIBCXX20_CONSTEXPR
  659. pair<_IIter1, _IIter2>
  660. mismatch(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
  661. template<typename _RAIter>
  662. _GLIBCXX20_CONSTEXPR
  663. void
  664. nth_element(_RAIter, _RAIter, _RAIter);
  665. template<typename _RAIter, typename _Compare>
  666. _GLIBCXX20_CONSTEXPR
  667. void
  668. nth_element(_RAIter, _RAIter, _RAIter, _Compare);
  669. template<typename _RAIter>
  670. _GLIBCXX20_CONSTEXPR
  671. void
  672. partial_sort(_RAIter, _RAIter, _RAIter);
  673. template<typename _RAIter, typename _Compare>
  674. _GLIBCXX20_CONSTEXPR
  675. void
  676. partial_sort(_RAIter, _RAIter, _RAIter, _Compare);
  677. template<typename _BIter, typename _Predicate>
  678. _GLIBCXX20_CONSTEXPR
  679. _BIter
  680. partition(_BIter, _BIter, _Predicate);
  681. template<typename _RAIter>
  682. void
  683. random_shuffle(_RAIter, _RAIter);
  684. template<typename _RAIter, typename _Generator>
  685. void
  686. random_shuffle(_RAIter, _RAIter,
  687. #if __cplusplus >= 201103L
  688. _Generator&&);
  689. #else
  690. _Generator&);
  691. #endif
  692. template<typename _FIter, typename _Tp>
  693. _GLIBCXX20_CONSTEXPR
  694. void
  695. replace(_FIter, _FIter, const _Tp&, const _Tp&);
  696. template<typename _FIter, typename _Predicate, typename _Tp>
  697. _GLIBCXX20_CONSTEXPR
  698. void
  699. replace_if(_FIter, _FIter, _Predicate, const _Tp&);
  700. template<typename _FIter1, typename _FIter2>
  701. _GLIBCXX20_CONSTEXPR
  702. _FIter1
  703. search(_FIter1, _FIter1, _FIter2, _FIter2);
  704. template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
  705. _GLIBCXX20_CONSTEXPR
  706. _FIter1
  707. search(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
  708. template<typename _FIter, typename _Size, typename _Tp>
  709. _GLIBCXX20_CONSTEXPR
  710. _FIter
  711. search_n(_FIter, _FIter, _Size, const _Tp&);
  712. template<typename _FIter, typename _Size, typename _Tp,
  713. typename _BinaryPredicate>
  714. _GLIBCXX20_CONSTEXPR
  715. _FIter
  716. search_n(_FIter, _FIter, _Size, const _Tp&, _BinaryPredicate);
  717. template<typename _IIter1, typename _IIter2, typename _OIter>
  718. _GLIBCXX20_CONSTEXPR
  719. _OIter
  720. set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
  721. template<typename _IIter1, typename _IIter2, typename _OIter,
  722. typename _Compare>
  723. _GLIBCXX20_CONSTEXPR
  724. _OIter
  725. set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
  726. template<typename _IIter1, typename _IIter2, typename _OIter>
  727. _GLIBCXX20_CONSTEXPR
  728. _OIter
  729. set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
  730. template<typename _IIter1, typename _IIter2, typename _OIter,
  731. typename _Compare>
  732. _GLIBCXX20_CONSTEXPR
  733. _OIter
  734. set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
  735. template<typename _IIter1, typename _IIter2, typename _OIter>
  736. _GLIBCXX20_CONSTEXPR
  737. _OIter
  738. set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
  739. template<typename _IIter1, typename _IIter2, typename _OIter,
  740. typename _Compare>
  741. _GLIBCXX20_CONSTEXPR
  742. _OIter
  743. set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2,
  744. _OIter, _Compare);
  745. template<typename _IIter1, typename _IIter2, typename _OIter>
  746. _GLIBCXX20_CONSTEXPR
  747. _OIter
  748. set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
  749. template<typename _IIter1, typename _IIter2, typename _OIter,
  750. typename _Compare>
  751. _GLIBCXX20_CONSTEXPR
  752. _OIter
  753. set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
  754. template<typename _RAIter>
  755. _GLIBCXX20_CONSTEXPR
  756. void
  757. sort(_RAIter, _RAIter);
  758. template<typename _RAIter, typename _Compare>
  759. _GLIBCXX20_CONSTEXPR
  760. void
  761. sort(_RAIter, _RAIter, _Compare);
  762. template<typename _RAIter>
  763. void
  764. stable_sort(_RAIter, _RAIter);
  765. template<typename _RAIter, typename _Compare>
  766. void
  767. stable_sort(_RAIter, _RAIter, _Compare);
  768. template<typename _IIter, typename _OIter, typename _UnaryOperation>
  769. _GLIBCXX20_CONSTEXPR
  770. _OIter
  771. transform(_IIter, _IIter, _OIter, _UnaryOperation);
  772. template<typename _IIter1, typename _IIter2, typename _OIter,
  773. typename _BinaryOperation>
  774. _GLIBCXX20_CONSTEXPR
  775. _OIter
  776. transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation);
  777. template<typename _IIter, typename _OIter>
  778. _GLIBCXX20_CONSTEXPR
  779. _OIter
  780. unique_copy(_IIter, _IIter, _OIter);
  781. template<typename _IIter, typename _OIter, typename _BinaryPredicate>
  782. _GLIBCXX20_CONSTEXPR
  783. _OIter
  784. unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate);
  785. _GLIBCXX_END_NAMESPACE_ALGO
  786. _GLIBCXX_END_NAMESPACE_VERSION
  787. } // namespace std
  788. #ifdef _GLIBCXX_PARALLEL
  789. # include <parallel/algorithmfwd.h>
  790. #endif
  791. #endif