algorithmfwd.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  1. // <algorithm> Forward declarations -*- C++ -*-
  2. // Copyright (C) 2007-2018 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 Operation
  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 >= 201103L
  177. template<typename _IIter, typename _Predicate>
  178. bool
  179. all_of(_IIter, _IIter, _Predicate);
  180. template<typename _IIter, typename _Predicate>
  181. bool
  182. any_of(_IIter, _IIter, _Predicate);
  183. #endif
  184. template<typename _FIter, typename _Tp>
  185. bool
  186. binary_search(_FIter, _FIter, const _Tp&);
  187. template<typename _FIter, typename _Tp, typename _Compare>
  188. bool
  189. binary_search(_FIter, _FIter, const _Tp&, _Compare);
  190. #if __cplusplus > 201402L
  191. template<typename _Tp>
  192. _GLIBCXX14_CONSTEXPR
  193. const _Tp&
  194. clamp(const _Tp&, const _Tp&, const _Tp&);
  195. template<typename _Tp, typename _Compare>
  196. _GLIBCXX14_CONSTEXPR
  197. const _Tp&
  198. clamp(const _Tp&, const _Tp&, const _Tp&, _Compare);
  199. #endif
  200. template<typename _IIter, typename _OIter>
  201. _OIter
  202. copy(_IIter, _IIter, _OIter);
  203. template<typename _BIter1, typename _BIter2>
  204. _BIter2
  205. copy_backward(_BIter1, _BIter1, _BIter2);
  206. #if __cplusplus >= 201103L
  207. template<typename _IIter, typename _OIter, typename _Predicate>
  208. _OIter
  209. copy_if(_IIter, _IIter, _OIter, _Predicate);
  210. template<typename _IIter, typename _Size, typename _OIter>
  211. _OIter
  212. copy_n(_IIter, _Size, _OIter);
  213. #endif
  214. // count
  215. // count_if
  216. template<typename _FIter, typename _Tp>
  217. pair<_FIter, _FIter>
  218. equal_range(_FIter, _FIter, const _Tp&);
  219. template<typename _FIter, typename _Tp, typename _Compare>
  220. pair<_FIter, _FIter>
  221. equal_range(_FIter, _FIter, const _Tp&, _Compare);
  222. template<typename _FIter, typename _Tp>
  223. void
  224. fill(_FIter, _FIter, const _Tp&);
  225. template<typename _OIter, typename _Size, typename _Tp>
  226. _OIter
  227. fill_n(_OIter, _Size, const _Tp&);
  228. // find
  229. template<typename _FIter1, typename _FIter2>
  230. _FIter1
  231. find_end(_FIter1, _FIter1, _FIter2, _FIter2);
  232. template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
  233. _FIter1
  234. find_end(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
  235. // find_first_of
  236. // find_if
  237. #if __cplusplus >= 201103L
  238. template<typename _IIter, typename _Predicate>
  239. _IIter
  240. find_if_not(_IIter, _IIter, _Predicate);
  241. #endif
  242. // for_each
  243. // generate
  244. // generate_n
  245. template<typename _IIter1, typename _IIter2>
  246. bool
  247. includes(_IIter1, _IIter1, _IIter2, _IIter2);
  248. template<typename _IIter1, typename _IIter2, typename _Compare>
  249. bool
  250. includes(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
  251. template<typename _BIter>
  252. void
  253. inplace_merge(_BIter, _BIter, _BIter);
  254. template<typename _BIter, typename _Compare>
  255. void
  256. inplace_merge(_BIter, _BIter, _BIter, _Compare);
  257. #if __cplusplus >= 201103L
  258. template<typename _RAIter>
  259. bool
  260. is_heap(_RAIter, _RAIter);
  261. template<typename _RAIter, typename _Compare>
  262. bool
  263. is_heap(_RAIter, _RAIter, _Compare);
  264. template<typename _RAIter>
  265. _RAIter
  266. is_heap_until(_RAIter, _RAIter);
  267. template<typename _RAIter, typename _Compare>
  268. _RAIter
  269. is_heap_until(_RAIter, _RAIter, _Compare);
  270. template<typename _IIter, typename _Predicate>
  271. bool
  272. is_partitioned(_IIter, _IIter, _Predicate);
  273. template<typename _FIter1, typename _FIter2>
  274. bool
  275. is_permutation(_FIter1, _FIter1, _FIter2);
  276. template<typename _FIter1, typename _FIter2,
  277. typename _BinaryPredicate>
  278. bool
  279. is_permutation(_FIter1, _FIter1, _FIter2, _BinaryPredicate);
  280. template<typename _FIter>
  281. bool
  282. is_sorted(_FIter, _FIter);
  283. template<typename _FIter, typename _Compare>
  284. bool
  285. is_sorted(_FIter, _FIter, _Compare);
  286. template<typename _FIter>
  287. _FIter
  288. is_sorted_until(_FIter, _FIter);
  289. template<typename _FIter, typename _Compare>
  290. _FIter
  291. is_sorted_until(_FIter, _FIter, _Compare);
  292. #endif
  293. template<typename _FIter1, typename _FIter2>
  294. void
  295. iter_swap(_FIter1, _FIter2);
  296. template<typename _FIter, typename _Tp>
  297. _FIter
  298. lower_bound(_FIter, _FIter, const _Tp&);
  299. template<typename _FIter, typename _Tp, typename _Compare>
  300. _FIter
  301. lower_bound(_FIter, _FIter, const _Tp&, _Compare);
  302. template<typename _RAIter>
  303. void
  304. make_heap(_RAIter, _RAIter);
  305. template<typename _RAIter, typename _Compare>
  306. void
  307. make_heap(_RAIter, _RAIter, _Compare);
  308. template<typename _Tp>
  309. _GLIBCXX14_CONSTEXPR
  310. const _Tp&
  311. max(const _Tp&, const _Tp&);
  312. template<typename _Tp, typename _Compare>
  313. _GLIBCXX14_CONSTEXPR
  314. const _Tp&
  315. max(const _Tp&, const _Tp&, _Compare);
  316. // max_element
  317. // merge
  318. template<typename _Tp>
  319. _GLIBCXX14_CONSTEXPR
  320. const _Tp&
  321. min(const _Tp&, const _Tp&);
  322. template<typename _Tp, typename _Compare>
  323. _GLIBCXX14_CONSTEXPR
  324. const _Tp&
  325. min(const _Tp&, const _Tp&, _Compare);
  326. // min_element
  327. #if __cplusplus >= 201103L
  328. template<typename _Tp>
  329. _GLIBCXX14_CONSTEXPR
  330. pair<const _Tp&, const _Tp&>
  331. minmax(const _Tp&, const _Tp&);
  332. template<typename _Tp, typename _Compare>
  333. _GLIBCXX14_CONSTEXPR
  334. pair<const _Tp&, const _Tp&>
  335. minmax(const _Tp&, const _Tp&, _Compare);
  336. template<typename _FIter>
  337. _GLIBCXX14_CONSTEXPR
  338. pair<_FIter, _FIter>
  339. minmax_element(_FIter, _FIter);
  340. template<typename _FIter, typename _Compare>
  341. _GLIBCXX14_CONSTEXPR
  342. pair<_FIter, _FIter>
  343. minmax_element(_FIter, _FIter, _Compare);
  344. template<typename _Tp>
  345. _GLIBCXX14_CONSTEXPR
  346. _Tp
  347. min(initializer_list<_Tp>);
  348. template<typename _Tp, typename _Compare>
  349. _GLIBCXX14_CONSTEXPR
  350. _Tp
  351. min(initializer_list<_Tp>, _Compare);
  352. template<typename _Tp>
  353. _GLIBCXX14_CONSTEXPR
  354. _Tp
  355. max(initializer_list<_Tp>);
  356. template<typename _Tp, typename _Compare>
  357. _GLIBCXX14_CONSTEXPR
  358. _Tp
  359. max(initializer_list<_Tp>, _Compare);
  360. template<typename _Tp>
  361. _GLIBCXX14_CONSTEXPR
  362. pair<_Tp, _Tp>
  363. minmax(initializer_list<_Tp>);
  364. template<typename _Tp, typename _Compare>
  365. _GLIBCXX14_CONSTEXPR
  366. pair<_Tp, _Tp>
  367. minmax(initializer_list<_Tp>, _Compare);
  368. #endif
  369. // mismatch
  370. template<typename _BIter>
  371. bool
  372. next_permutation(_BIter, _BIter);
  373. template<typename _BIter, typename _Compare>
  374. bool
  375. next_permutation(_BIter, _BIter, _Compare);
  376. #if __cplusplus >= 201103L
  377. template<typename _IIter, typename _Predicate>
  378. bool
  379. none_of(_IIter, _IIter, _Predicate);
  380. #endif
  381. // nth_element
  382. // partial_sort
  383. template<typename _IIter, typename _RAIter>
  384. _RAIter
  385. partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter);
  386. template<typename _IIter, typename _RAIter, typename _Compare>
  387. _RAIter
  388. partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter, _Compare);
  389. // partition
  390. #if __cplusplus >= 201103L
  391. template<typename _IIter, typename _OIter1,
  392. typename _OIter2, typename _Predicate>
  393. pair<_OIter1, _OIter2>
  394. partition_copy(_IIter, _IIter, _OIter1, _OIter2, _Predicate);
  395. template<typename _FIter, typename _Predicate>
  396. _FIter
  397. partition_point(_FIter, _FIter, _Predicate);
  398. #endif
  399. template<typename _RAIter>
  400. void
  401. pop_heap(_RAIter, _RAIter);
  402. template<typename _RAIter, typename _Compare>
  403. void
  404. pop_heap(_RAIter, _RAIter, _Compare);
  405. template<typename _BIter>
  406. bool
  407. prev_permutation(_BIter, _BIter);
  408. template<typename _BIter, typename _Compare>
  409. bool
  410. prev_permutation(_BIter, _BIter, _Compare);
  411. template<typename _RAIter>
  412. void
  413. push_heap(_RAIter, _RAIter);
  414. template<typename _RAIter, typename _Compare>
  415. void
  416. push_heap(_RAIter, _RAIter, _Compare);
  417. // random_shuffle
  418. template<typename _FIter, typename _Tp>
  419. _FIter
  420. remove(_FIter, _FIter, const _Tp&);
  421. template<typename _FIter, typename _Predicate>
  422. _FIter
  423. remove_if(_FIter, _FIter, _Predicate);
  424. template<typename _IIter, typename _OIter, typename _Tp>
  425. _OIter
  426. remove_copy(_IIter, _IIter, _OIter, const _Tp&);
  427. template<typename _IIter, typename _OIter, typename _Predicate>
  428. _OIter
  429. remove_copy_if(_IIter, _IIter, _OIter, _Predicate);
  430. // replace
  431. template<typename _IIter, typename _OIter, typename _Tp>
  432. _OIter
  433. replace_copy(_IIter, _IIter, _OIter, const _Tp&, const _Tp&);
  434. template<typename _Iter, typename _OIter, typename _Predicate, typename _Tp>
  435. _OIter
  436. replace_copy_if(_Iter, _Iter, _OIter, _Predicate, const _Tp&);
  437. // replace_if
  438. template<typename _BIter>
  439. void
  440. reverse(_BIter, _BIter);
  441. template<typename _BIter, typename _OIter>
  442. _OIter
  443. reverse_copy(_BIter, _BIter, _OIter);
  444. inline namespace _V2
  445. {
  446. template<typename _FIter>
  447. _FIter
  448. rotate(_FIter, _FIter, _FIter);
  449. }
  450. template<typename _FIter, typename _OIter>
  451. _OIter
  452. rotate_copy(_FIter, _FIter, _FIter, _OIter);
  453. // search
  454. // search_n
  455. // set_difference
  456. // set_intersection
  457. // set_symmetric_difference
  458. // set_union
  459. #if (__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
  460. template<typename _RAIter, typename _UGenerator>
  461. void
  462. shuffle(_RAIter, _RAIter, _UGenerator&&);
  463. #endif
  464. template<typename _RAIter>
  465. void
  466. sort_heap(_RAIter, _RAIter);
  467. template<typename _RAIter, typename _Compare>
  468. void
  469. sort_heap(_RAIter, _RAIter, _Compare);
  470. template<typename _BIter, typename _Predicate>
  471. _BIter
  472. stable_partition(_BIter, _BIter, _Predicate);
  473. #if __cplusplus < 201103L
  474. // For C++11 swap() is declared in <type_traits>.
  475. template<typename _Tp, size_t _Nm>
  476. inline void
  477. swap(_Tp& __a, _Tp& __b);
  478. template<typename _Tp, size_t _Nm>
  479. inline void
  480. swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]);
  481. #endif
  482. template<typename _FIter1, typename _FIter2>
  483. _FIter2
  484. swap_ranges(_FIter1, _FIter1, _FIter2);
  485. // transform
  486. template<typename _FIter>
  487. _FIter
  488. unique(_FIter, _FIter);
  489. template<typename _FIter, typename _BinaryPredicate>
  490. _FIter
  491. unique(_FIter, _FIter, _BinaryPredicate);
  492. // unique_copy
  493. template<typename _FIter, typename _Tp>
  494. _FIter
  495. upper_bound(_FIter, _FIter, const _Tp&);
  496. template<typename _FIter, typename _Tp, typename _Compare>
  497. _FIter
  498. upper_bound(_FIter, _FIter, const _Tp&, _Compare);
  499. _GLIBCXX_BEGIN_NAMESPACE_ALGO
  500. template<typename _FIter>
  501. _FIter
  502. adjacent_find(_FIter, _FIter);
  503. template<typename _FIter, typename _BinaryPredicate>
  504. _FIter
  505. adjacent_find(_FIter, _FIter, _BinaryPredicate);
  506. template<typename _IIter, typename _Tp>
  507. typename iterator_traits<_IIter>::difference_type
  508. count(_IIter, _IIter, const _Tp&);
  509. template<typename _IIter, typename _Predicate>
  510. typename iterator_traits<_IIter>::difference_type
  511. count_if(_IIter, _IIter, _Predicate);
  512. template<typename _IIter1, typename _IIter2>
  513. bool
  514. equal(_IIter1, _IIter1, _IIter2);
  515. template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
  516. bool
  517. equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
  518. template<typename _IIter, typename _Tp>
  519. _IIter
  520. find(_IIter, _IIter, const _Tp&);
  521. template<typename _FIter1, typename _FIter2>
  522. _FIter1
  523. find_first_of(_FIter1, _FIter1, _FIter2, _FIter2);
  524. template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
  525. _FIter1
  526. find_first_of(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
  527. template<typename _IIter, typename _Predicate>
  528. _IIter
  529. find_if(_IIter, _IIter, _Predicate);
  530. template<typename _IIter, typename _Funct>
  531. _Funct
  532. for_each(_IIter, _IIter, _Funct);
  533. template<typename _FIter, typename _Generator>
  534. void
  535. generate(_FIter, _FIter, _Generator);
  536. template<typename _OIter, typename _Size, typename _Generator>
  537. _OIter
  538. generate_n(_OIter, _Size, _Generator);
  539. template<typename _IIter1, typename _IIter2>
  540. bool
  541. lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2);
  542. template<typename _IIter1, typename _IIter2, typename _Compare>
  543. bool
  544. lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
  545. template<typename _FIter>
  546. _GLIBCXX14_CONSTEXPR
  547. _FIter
  548. max_element(_FIter, _FIter);
  549. template<typename _FIter, typename _Compare>
  550. _GLIBCXX14_CONSTEXPR
  551. _FIter
  552. max_element(_FIter, _FIter, _Compare);
  553. template<typename _IIter1, typename _IIter2, typename _OIter>
  554. _OIter
  555. merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
  556. template<typename _IIter1, typename _IIter2, typename _OIter,
  557. typename _Compare>
  558. _OIter
  559. merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
  560. template<typename _FIter>
  561. _GLIBCXX14_CONSTEXPR
  562. _FIter
  563. min_element(_FIter, _FIter);
  564. template<typename _FIter, typename _Compare>
  565. _GLIBCXX14_CONSTEXPR
  566. _FIter
  567. min_element(_FIter, _FIter, _Compare);
  568. template<typename _IIter1, typename _IIter2>
  569. pair<_IIter1, _IIter2>
  570. mismatch(_IIter1, _IIter1, _IIter2);
  571. template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
  572. pair<_IIter1, _IIter2>
  573. mismatch(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
  574. template<typename _RAIter>
  575. void
  576. nth_element(_RAIter, _RAIter, _RAIter);
  577. template<typename _RAIter, typename _Compare>
  578. void
  579. nth_element(_RAIter, _RAIter, _RAIter, _Compare);
  580. template<typename _RAIter>
  581. void
  582. partial_sort(_RAIter, _RAIter, _RAIter);
  583. template<typename _RAIter, typename _Compare>
  584. void
  585. partial_sort(_RAIter, _RAIter, _RAIter, _Compare);
  586. template<typename _BIter, typename _Predicate>
  587. _BIter
  588. partition(_BIter, _BIter, _Predicate);
  589. template<typename _RAIter>
  590. void
  591. random_shuffle(_RAIter, _RAIter);
  592. template<typename _RAIter, typename _Generator>
  593. void
  594. random_shuffle(_RAIter, _RAIter,
  595. #if __cplusplus >= 201103L
  596. _Generator&&);
  597. #else
  598. _Generator&);
  599. #endif
  600. template<typename _FIter, typename _Tp>
  601. void
  602. replace(_FIter, _FIter, const _Tp&, const _Tp&);
  603. template<typename _FIter, typename _Predicate, typename _Tp>
  604. void
  605. replace_if(_FIter, _FIter, _Predicate, const _Tp&);
  606. template<typename _FIter1, typename _FIter2>
  607. _FIter1
  608. search(_FIter1, _FIter1, _FIter2, _FIter2);
  609. template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
  610. _FIter1
  611. search(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
  612. template<typename _FIter, typename _Size, typename _Tp>
  613. _FIter
  614. search_n(_FIter, _FIter, _Size, const _Tp&);
  615. template<typename _FIter, typename _Size, typename _Tp,
  616. typename _BinaryPredicate>
  617. _FIter
  618. search_n(_FIter, _FIter, _Size, const _Tp&, _BinaryPredicate);
  619. template<typename _IIter1, typename _IIter2, typename _OIter>
  620. _OIter
  621. set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
  622. template<typename _IIter1, typename _IIter2, typename _OIter,
  623. typename _Compare>
  624. _OIter
  625. set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
  626. template<typename _IIter1, typename _IIter2, typename _OIter>
  627. _OIter
  628. set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
  629. template<typename _IIter1, typename _IIter2, typename _OIter,
  630. typename _Compare>
  631. _OIter
  632. set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
  633. template<typename _IIter1, typename _IIter2, typename _OIter>
  634. _OIter
  635. set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
  636. template<typename _IIter1, typename _IIter2, typename _OIter,
  637. typename _Compare>
  638. _OIter
  639. set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2,
  640. _OIter, _Compare);
  641. template<typename _IIter1, typename _IIter2, typename _OIter>
  642. _OIter
  643. set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
  644. template<typename _IIter1, typename _IIter2, typename _OIter,
  645. typename _Compare>
  646. _OIter
  647. set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
  648. template<typename _RAIter>
  649. void
  650. sort(_RAIter, _RAIter);
  651. template<typename _RAIter, typename _Compare>
  652. void
  653. sort(_RAIter, _RAIter, _Compare);
  654. template<typename _RAIter>
  655. void
  656. stable_sort(_RAIter, _RAIter);
  657. template<typename _RAIter, typename _Compare>
  658. void
  659. stable_sort(_RAIter, _RAIter, _Compare);
  660. template<typename _IIter, typename _OIter, typename _UnaryOperation>
  661. _OIter
  662. transform(_IIter, _IIter, _OIter, _UnaryOperation);
  663. template<typename _IIter1, typename _IIter2, typename _OIter,
  664. typename _BinaryOperation>
  665. _OIter
  666. transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation);
  667. template<typename _IIter, typename _OIter>
  668. _OIter
  669. unique_copy(_IIter, _IIter, _OIter);
  670. template<typename _IIter, typename _OIter, typename _BinaryPredicate>
  671. _OIter
  672. unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate);
  673. _GLIBCXX_END_NAMESPACE_ALGO
  674. _GLIBCXX_END_NAMESPACE_VERSION
  675. } // namespace std
  676. #ifdef _GLIBCXX_PARALLEL
  677. # include <parallel/algorithmfwd.h>
  678. #endif
  679. #endif