libstdc++
|
00001 // <algorithm> Forward declarations -*- C++ -*- 00002 00003 // Copyright (C) 2007-2017 Free Software Foundation, Inc. 00004 // 00005 // This file is part of the GNU ISO C++ Library. This library is free 00006 // software; you can redistribute it and/or modify it under the 00007 // terms of the GNU General Public License as published by the 00008 // Free Software Foundation; either version 3, or (at your option) 00009 // any later version. 00010 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 00016 // Under Section 7 of GPL version 3, you are granted additional 00017 // permissions described in the GCC Runtime Library Exception, version 00018 // 3.1, as published by the Free Software Foundation. 00019 00020 // You should have received a copy of the GNU General Public License and 00021 // a copy of the GCC Runtime Library Exception along with this program; 00022 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 00023 // <http://www.gnu.org/licenses/>. 00024 00025 /** @file bits/algorithmfwd.h 00026 * This is an internal header file, included by other library headers. 00027 * Do not attempt to use it directly. @headername{algorithm} 00028 */ 00029 00030 #ifndef _GLIBCXX_ALGORITHMFWD_H 00031 #define _GLIBCXX_ALGORITHMFWD_H 1 00032 00033 #pragma GCC system_header 00034 00035 #include <bits/c++config.h> 00036 #include <bits/stl_pair.h> 00037 #include <bits/stl_iterator_base_types.h> 00038 #if __cplusplus >= 201103L 00039 #include <initializer_list> 00040 #endif 00041 00042 namespace std _GLIBCXX_VISIBILITY(default) 00043 { 00044 _GLIBCXX_BEGIN_NAMESPACE_VERSION 00045 00046 /* 00047 adjacent_find 00048 all_of (C++11) 00049 any_of (C++11) 00050 binary_search 00051 clamp (C++17) 00052 copy 00053 copy_backward 00054 copy_if (C++11) 00055 copy_n (C++11) 00056 count 00057 count_if 00058 equal 00059 equal_range 00060 fill 00061 fill_n 00062 find 00063 find_end 00064 find_first_of 00065 find_if 00066 find_if_not (C++11) 00067 for_each 00068 generate 00069 generate_n 00070 includes 00071 inplace_merge 00072 is_heap (C++11) 00073 is_heap_until (C++11) 00074 is_partitioned (C++11) 00075 is_sorted (C++11) 00076 is_sorted_until (C++11) 00077 iter_swap 00078 lexicographical_compare 00079 lower_bound 00080 make_heap 00081 max 00082 max_element 00083 merge 00084 min 00085 min_element 00086 minmax (C++11) 00087 minmax_element (C++11) 00088 mismatch 00089 next_permutation 00090 none_of (C++11) 00091 nth_element 00092 partial_sort 00093 partial_sort_copy 00094 partition 00095 partition_copy (C++11) 00096 partition_point (C++11) 00097 pop_heap 00098 prev_permutation 00099 push_heap 00100 random_shuffle 00101 remove 00102 remove_copy 00103 remove_copy_if 00104 remove_if 00105 replace 00106 replace_copy 00107 replace_copy_if 00108 replace_if 00109 reverse 00110 reverse_copy 00111 rotate 00112 rotate_copy 00113 search 00114 search_n 00115 set_difference 00116 set_intersection 00117 set_symmetric_difference 00118 set_union 00119 shuffle (C++11) 00120 sort 00121 sort_heap 00122 stable_partition 00123 stable_sort 00124 swap 00125 swap_ranges 00126 transform 00127 unique 00128 unique_copy 00129 upper_bound 00130 */ 00131 00132 /** 00133 * @defgroup algorithms Algorithms 00134 * 00135 * Components for performing algorithmic operations. Includes 00136 * non-modifying sequence, modifying (mutating) sequence, sorting, 00137 * searching, merge, partition, heap, set, minima, maxima, and 00138 * permutation operations. 00139 */ 00140 00141 /** 00142 * @defgroup mutating_algorithms Mutating 00143 * @ingroup algorithms 00144 */ 00145 00146 /** 00147 * @defgroup non_mutating_algorithms Non-Mutating 00148 * @ingroup algorithms 00149 */ 00150 00151 /** 00152 * @defgroup sorting_algorithms Sorting 00153 * @ingroup algorithms 00154 */ 00155 00156 /** 00157 * @defgroup set_algorithms Set Operation 00158 * @ingroup sorting_algorithms 00159 * 00160 * These algorithms are common set operations performed on sequences 00161 * that are already sorted. The number of comparisons will be 00162 * linear. 00163 */ 00164 00165 /** 00166 * @defgroup binary_search_algorithms Binary Search 00167 * @ingroup sorting_algorithms 00168 * 00169 * These algorithms are variations of a classic binary search, and 00170 * all assume that the sequence being searched is already sorted. 00171 * 00172 * The number of comparisons will be logarithmic (and as few as 00173 * possible). The number of steps through the sequence will be 00174 * logarithmic for random-access iterators (e.g., pointers), and 00175 * linear otherwise. 00176 * 00177 * The LWG has passed Defect Report 270, which notes: <em>The 00178 * proposed resolution reinterprets binary search. Instead of 00179 * thinking about searching for a value in a sorted range, we view 00180 * that as an important special case of a more general algorithm: 00181 * searching for the partition point in a partitioned range. We 00182 * also add a guarantee that the old wording did not: we ensure that 00183 * the upper bound is no earlier than the lower bound, that the pair 00184 * returned by equal_range is a valid range, and that the first part 00185 * of that pair is the lower bound.</em> 00186 * 00187 * The actual effect of the first sentence is that a comparison 00188 * functor passed by the user doesn't necessarily need to induce a 00189 * strict weak ordering relation. Rather, it partitions the range. 00190 */ 00191 00192 // adjacent_find 00193 00194 #if __cplusplus >= 201103L 00195 template<typename _IIter, typename _Predicate> 00196 bool 00197 all_of(_IIter, _IIter, _Predicate); 00198 00199 template<typename _IIter, typename _Predicate> 00200 bool 00201 any_of(_IIter, _IIter, _Predicate); 00202 #endif 00203 00204 template<typename _FIter, typename _Tp> 00205 bool 00206 binary_search(_FIter, _FIter, const _Tp&); 00207 00208 template<typename _FIter, typename _Tp, typename _Compare> 00209 bool 00210 binary_search(_FIter, _FIter, const _Tp&, _Compare); 00211 00212 #if __cplusplus > 201402L 00213 template<typename _Tp> 00214 _GLIBCXX14_CONSTEXPR 00215 const _Tp& 00216 clamp(const _Tp&, const _Tp&, const _Tp&); 00217 00218 template<typename _Tp, typename _Compare> 00219 _GLIBCXX14_CONSTEXPR 00220 const _Tp& 00221 clamp(const _Tp&, const _Tp&, const _Tp&, _Compare); 00222 #endif 00223 00224 template<typename _IIter, typename _OIter> 00225 _OIter 00226 copy(_IIter, _IIter, _OIter); 00227 00228 template<typename _BIter1, typename _BIter2> 00229 _BIter2 00230 copy_backward(_BIter1, _BIter1, _BIter2); 00231 00232 #if __cplusplus >= 201103L 00233 template<typename _IIter, typename _OIter, typename _Predicate> 00234 _OIter 00235 copy_if(_IIter, _IIter, _OIter, _Predicate); 00236 00237 template<typename _IIter, typename _Size, typename _OIter> 00238 _OIter 00239 copy_n(_IIter, _Size, _OIter); 00240 #endif 00241 00242 // count 00243 // count_if 00244 00245 template<typename _FIter, typename _Tp> 00246 pair<_FIter, _FIter> 00247 equal_range(_FIter, _FIter, const _Tp&); 00248 00249 template<typename _FIter, typename _Tp, typename _Compare> 00250 pair<_FIter, _FIter> 00251 equal_range(_FIter, _FIter, const _Tp&, _Compare); 00252 00253 template<typename _FIter, typename _Tp> 00254 void 00255 fill(_FIter, _FIter, const _Tp&); 00256 00257 template<typename _OIter, typename _Size, typename _Tp> 00258 _OIter 00259 fill_n(_OIter, _Size, const _Tp&); 00260 00261 // find 00262 00263 template<typename _FIter1, typename _FIter2> 00264 _FIter1 00265 find_end(_FIter1, _FIter1, _FIter2, _FIter2); 00266 00267 template<typename _FIter1, typename _FIter2, typename _BinaryPredicate> 00268 _FIter1 00269 find_end(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate); 00270 00271 // find_first_of 00272 // find_if 00273 00274 #if __cplusplus >= 201103L 00275 template<typename _IIter, typename _Predicate> 00276 _IIter 00277 find_if_not(_IIter, _IIter, _Predicate); 00278 #endif 00279 00280 // for_each 00281 // generate 00282 // generate_n 00283 00284 template<typename _IIter1, typename _IIter2> 00285 bool 00286 includes(_IIter1, _IIter1, _IIter2, _IIter2); 00287 00288 template<typename _IIter1, typename _IIter2, typename _Compare> 00289 bool 00290 includes(_IIter1, _IIter1, _IIter2, _IIter2, _Compare); 00291 00292 template<typename _BIter> 00293 void 00294 inplace_merge(_BIter, _BIter, _BIter); 00295 00296 template<typename _BIter, typename _Compare> 00297 void 00298 inplace_merge(_BIter, _BIter, _BIter, _Compare); 00299 00300 #if __cplusplus >= 201103L 00301 template<typename _RAIter> 00302 bool 00303 is_heap(_RAIter, _RAIter); 00304 00305 template<typename _RAIter, typename _Compare> 00306 bool 00307 is_heap(_RAIter, _RAIter, _Compare); 00308 00309 template<typename _RAIter> 00310 _RAIter 00311 is_heap_until(_RAIter, _RAIter); 00312 00313 template<typename _RAIter, typename _Compare> 00314 _RAIter 00315 is_heap_until(_RAIter, _RAIter, _Compare); 00316 00317 template<typename _IIter, typename _Predicate> 00318 bool 00319 is_partitioned(_IIter, _IIter, _Predicate); 00320 00321 template<typename _FIter1, typename _FIter2> 00322 bool 00323 is_permutation(_FIter1, _FIter1, _FIter2); 00324 00325 template<typename _FIter1, typename _FIter2, 00326 typename _BinaryPredicate> 00327 bool 00328 is_permutation(_FIter1, _FIter1, _FIter2, _BinaryPredicate); 00329 00330 template<typename _FIter> 00331 bool 00332 is_sorted(_FIter, _FIter); 00333 00334 template<typename _FIter, typename _Compare> 00335 bool 00336 is_sorted(_FIter, _FIter, _Compare); 00337 00338 template<typename _FIter> 00339 _FIter 00340 is_sorted_until(_FIter, _FIter); 00341 00342 template<typename _FIter, typename _Compare> 00343 _FIter 00344 is_sorted_until(_FIter, _FIter, _Compare); 00345 #endif 00346 00347 template<typename _FIter1, typename _FIter2> 00348 void 00349 iter_swap(_FIter1, _FIter2); 00350 00351 template<typename _FIter, typename _Tp> 00352 _FIter 00353 lower_bound(_FIter, _FIter, const _Tp&); 00354 00355 template<typename _FIter, typename _Tp, typename _Compare> 00356 _FIter 00357 lower_bound(_FIter, _FIter, const _Tp&, _Compare); 00358 00359 template<typename _RAIter> 00360 void 00361 make_heap(_RAIter, _RAIter); 00362 00363 template<typename _RAIter, typename _Compare> 00364 void 00365 make_heap(_RAIter, _RAIter, _Compare); 00366 00367 template<typename _Tp> 00368 _GLIBCXX14_CONSTEXPR 00369 const _Tp& 00370 max(const _Tp&, const _Tp&); 00371 00372 template<typename _Tp, typename _Compare> 00373 _GLIBCXX14_CONSTEXPR 00374 const _Tp& 00375 max(const _Tp&, const _Tp&, _Compare); 00376 00377 // max_element 00378 // merge 00379 00380 template<typename _Tp> 00381 _GLIBCXX14_CONSTEXPR 00382 const _Tp& 00383 min(const _Tp&, const _Tp&); 00384 00385 template<typename _Tp, typename _Compare> 00386 _GLIBCXX14_CONSTEXPR 00387 const _Tp& 00388 min(const _Tp&, const _Tp&, _Compare); 00389 00390 // min_element 00391 00392 #if __cplusplus >= 201103L 00393 template<typename _Tp> 00394 _GLIBCXX14_CONSTEXPR 00395 pair<const _Tp&, const _Tp&> 00396 minmax(const _Tp&, const _Tp&); 00397 00398 template<typename _Tp, typename _Compare> 00399 _GLIBCXX14_CONSTEXPR 00400 pair<const _Tp&, const _Tp&> 00401 minmax(const _Tp&, const _Tp&, _Compare); 00402 00403 template<typename _FIter> 00404 _GLIBCXX14_CONSTEXPR 00405 pair<_FIter, _FIter> 00406 minmax_element(_FIter, _FIter); 00407 00408 template<typename _FIter, typename _Compare> 00409 _GLIBCXX14_CONSTEXPR 00410 pair<_FIter, _FIter> 00411 minmax_element(_FIter, _FIter, _Compare); 00412 00413 template<typename _Tp> 00414 _GLIBCXX14_CONSTEXPR 00415 _Tp 00416 min(initializer_list<_Tp>); 00417 00418 template<typename _Tp, typename _Compare> 00419 _GLIBCXX14_CONSTEXPR 00420 _Tp 00421 min(initializer_list<_Tp>, _Compare); 00422 00423 template<typename _Tp> 00424 _GLIBCXX14_CONSTEXPR 00425 _Tp 00426 max(initializer_list<_Tp>); 00427 00428 template<typename _Tp, typename _Compare> 00429 _GLIBCXX14_CONSTEXPR 00430 _Tp 00431 max(initializer_list<_Tp>, _Compare); 00432 00433 template<typename _Tp> 00434 _GLIBCXX14_CONSTEXPR 00435 pair<_Tp, _Tp> 00436 minmax(initializer_list<_Tp>); 00437 00438 template<typename _Tp, typename _Compare> 00439 _GLIBCXX14_CONSTEXPR 00440 pair<_Tp, _Tp> 00441 minmax(initializer_list<_Tp>, _Compare); 00442 #endif 00443 00444 // mismatch 00445 00446 template<typename _BIter> 00447 bool 00448 next_permutation(_BIter, _BIter); 00449 00450 template<typename _BIter, typename _Compare> 00451 bool 00452 next_permutation(_BIter, _BIter, _Compare); 00453 00454 #if __cplusplus >= 201103L 00455 template<typename _IIter, typename _Predicate> 00456 bool 00457 none_of(_IIter, _IIter, _Predicate); 00458 #endif 00459 00460 // nth_element 00461 // partial_sort 00462 00463 template<typename _IIter, typename _RAIter> 00464 _RAIter 00465 partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter); 00466 00467 template<typename _IIter, typename _RAIter, typename _Compare> 00468 _RAIter 00469 partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter, _Compare); 00470 00471 // partition 00472 00473 #if __cplusplus >= 201103L 00474 template<typename _IIter, typename _OIter1, 00475 typename _OIter2, typename _Predicate> 00476 pair<_OIter1, _OIter2> 00477 partition_copy(_IIter, _IIter, _OIter1, _OIter2, _Predicate); 00478 00479 template<typename _FIter, typename _Predicate> 00480 _FIter 00481 partition_point(_FIter, _FIter, _Predicate); 00482 #endif 00483 00484 template<typename _RAIter> 00485 void 00486 pop_heap(_RAIter, _RAIter); 00487 00488 template<typename _RAIter, typename _Compare> 00489 void 00490 pop_heap(_RAIter, _RAIter, _Compare); 00491 00492 template<typename _BIter> 00493 bool 00494 prev_permutation(_BIter, _BIter); 00495 00496 template<typename _BIter, typename _Compare> 00497 bool 00498 prev_permutation(_BIter, _BIter, _Compare); 00499 00500 template<typename _RAIter> 00501 void 00502 push_heap(_RAIter, _RAIter); 00503 00504 template<typename _RAIter, typename _Compare> 00505 void 00506 push_heap(_RAIter, _RAIter, _Compare); 00507 00508 // random_shuffle 00509 00510 template<typename _FIter, typename _Tp> 00511 _FIter 00512 remove(_FIter, _FIter, const _Tp&); 00513 00514 template<typename _FIter, typename _Predicate> 00515 _FIter 00516 remove_if(_FIter, _FIter, _Predicate); 00517 00518 template<typename _IIter, typename _OIter, typename _Tp> 00519 _OIter 00520 remove_copy(_IIter, _IIter, _OIter, const _Tp&); 00521 00522 template<typename _IIter, typename _OIter, typename _Predicate> 00523 _OIter 00524 remove_copy_if(_IIter, _IIter, _OIter, _Predicate); 00525 00526 // replace 00527 00528 template<typename _IIter, typename _OIter, typename _Tp> 00529 _OIter 00530 replace_copy(_IIter, _IIter, _OIter, const _Tp&, const _Tp&); 00531 00532 template<typename _Iter, typename _OIter, typename _Predicate, typename _Tp> 00533 _OIter 00534 replace_copy_if(_Iter, _Iter, _OIter, _Predicate, const _Tp&); 00535 00536 // replace_if 00537 00538 template<typename _BIter> 00539 void 00540 reverse(_BIter, _BIter); 00541 00542 template<typename _BIter, typename _OIter> 00543 _OIter 00544 reverse_copy(_BIter, _BIter, _OIter); 00545 00546 inline namespace _V2 00547 { 00548 template<typename _FIter> 00549 _FIter 00550 rotate(_FIter, _FIter, _FIter); 00551 } 00552 00553 template<typename _FIter, typename _OIter> 00554 _OIter 00555 rotate_copy(_FIter, _FIter, _FIter, _OIter); 00556 00557 // search 00558 // search_n 00559 // set_difference 00560 // set_intersection 00561 // set_symmetric_difference 00562 // set_union 00563 00564 #if (__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99_STDINT_TR1) 00565 template<typename _RAIter, typename _UGenerator> 00566 void 00567 shuffle(_RAIter, _RAIter, _UGenerator&&); 00568 #endif 00569 00570 template<typename _RAIter> 00571 void 00572 sort_heap(_RAIter, _RAIter); 00573 00574 template<typename _RAIter, typename _Compare> 00575 void 00576 sort_heap(_RAIter, _RAIter, _Compare); 00577 00578 template<typename _BIter, typename _Predicate> 00579 _BIter 00580 stable_partition(_BIter, _BIter, _Predicate); 00581 00582 #if __cplusplus < 201103L 00583 // For C++11 swap() is declared in <type_traits>. 00584 00585 template<typename _Tp, size_t _Nm> 00586 inline void 00587 swap(_Tp& __a, _Tp& __b); 00588 00589 template<typename _Tp, size_t _Nm> 00590 inline void 00591 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]); 00592 #endif 00593 00594 template<typename _FIter1, typename _FIter2> 00595 _FIter2 00596 swap_ranges(_FIter1, _FIter1, _FIter2); 00597 00598 // transform 00599 00600 template<typename _FIter> 00601 _FIter 00602 unique(_FIter, _FIter); 00603 00604 template<typename _FIter, typename _BinaryPredicate> 00605 _FIter 00606 unique(_FIter, _FIter, _BinaryPredicate); 00607 00608 // unique_copy 00609 00610 template<typename _FIter, typename _Tp> 00611 _FIter 00612 upper_bound(_FIter, _FIter, const _Tp&); 00613 00614 template<typename _FIter, typename _Tp, typename _Compare> 00615 _FIter 00616 upper_bound(_FIter, _FIter, const _Tp&, _Compare); 00617 00618 _GLIBCXX_END_NAMESPACE_VERSION 00619 00620 _GLIBCXX_BEGIN_NAMESPACE_ALGO 00621 00622 template<typename _FIter> 00623 _FIter 00624 adjacent_find(_FIter, _FIter); 00625 00626 template<typename _FIter, typename _BinaryPredicate> 00627 _FIter 00628 adjacent_find(_FIter, _FIter, _BinaryPredicate); 00629 00630 template<typename _IIter, typename _Tp> 00631 typename iterator_traits<_IIter>::difference_type 00632 count(_IIter, _IIter, const _Tp&); 00633 00634 template<typename _IIter, typename _Predicate> 00635 typename iterator_traits<_IIter>::difference_type 00636 count_if(_IIter, _IIter, _Predicate); 00637 00638 template<typename _IIter1, typename _IIter2> 00639 bool 00640 equal(_IIter1, _IIter1, _IIter2); 00641 00642 template<typename _IIter1, typename _IIter2, typename _BinaryPredicate> 00643 bool 00644 equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate); 00645 00646 template<typename _IIter, typename _Tp> 00647 _IIter 00648 find(_IIter, _IIter, const _Tp&); 00649 00650 template<typename _FIter1, typename _FIter2> 00651 _FIter1 00652 find_first_of(_FIter1, _FIter1, _FIter2, _FIter2); 00653 00654 template<typename _FIter1, typename _FIter2, typename _BinaryPredicate> 00655 _FIter1 00656 find_first_of(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate); 00657 00658 template<typename _IIter, typename _Predicate> 00659 _IIter 00660 find_if(_IIter, _IIter, _Predicate); 00661 00662 template<typename _IIter, typename _Funct> 00663 _Funct 00664 for_each(_IIter, _IIter, _Funct); 00665 00666 template<typename _FIter, typename _Generator> 00667 void 00668 generate(_FIter, _FIter, _Generator); 00669 00670 template<typename _OIter, typename _Size, typename _Generator> 00671 _OIter 00672 generate_n(_OIter, _Size, _Generator); 00673 00674 template<typename _IIter1, typename _IIter2> 00675 bool 00676 lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2); 00677 00678 template<typename _IIter1, typename _IIter2, typename _Compare> 00679 bool 00680 lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Compare); 00681 00682 template<typename _FIter> 00683 _GLIBCXX14_CONSTEXPR 00684 _FIter 00685 max_element(_FIter, _FIter); 00686 00687 template<typename _FIter, typename _Compare> 00688 _GLIBCXX14_CONSTEXPR 00689 _FIter 00690 max_element(_FIter, _FIter, _Compare); 00691 00692 template<typename _IIter1, typename _IIter2, typename _OIter> 00693 _OIter 00694 merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); 00695 00696 template<typename _IIter1, typename _IIter2, typename _OIter, 00697 typename _Compare> 00698 _OIter 00699 merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare); 00700 00701 template<typename _FIter> 00702 _GLIBCXX14_CONSTEXPR 00703 _FIter 00704 min_element(_FIter, _FIter); 00705 00706 template<typename _FIter, typename _Compare> 00707 _GLIBCXX14_CONSTEXPR 00708 _FIter 00709 min_element(_FIter, _FIter, _Compare); 00710 00711 template<typename _IIter1, typename _IIter2> 00712 pair<_IIter1, _IIter2> 00713 mismatch(_IIter1, _IIter1, _IIter2); 00714 00715 template<typename _IIter1, typename _IIter2, typename _BinaryPredicate> 00716 pair<_IIter1, _IIter2> 00717 mismatch(_IIter1, _IIter1, _IIter2, _BinaryPredicate); 00718 00719 template<typename _RAIter> 00720 void 00721 nth_element(_RAIter, _RAIter, _RAIter); 00722 00723 template<typename _RAIter, typename _Compare> 00724 void 00725 nth_element(_RAIter, _RAIter, _RAIter, _Compare); 00726 00727 template<typename _RAIter> 00728 void 00729 partial_sort(_RAIter, _RAIter, _RAIter); 00730 00731 template<typename _RAIter, typename _Compare> 00732 void 00733 partial_sort(_RAIter, _RAIter, _RAIter, _Compare); 00734 00735 template<typename _BIter, typename _Predicate> 00736 _BIter 00737 partition(_BIter, _BIter, _Predicate); 00738 00739 template<typename _RAIter> 00740 void 00741 random_shuffle(_RAIter, _RAIter); 00742 00743 template<typename _RAIter, typename _Generator> 00744 void 00745 random_shuffle(_RAIter, _RAIter, 00746 #if __cplusplus >= 201103L 00747 _Generator&&); 00748 #else 00749 _Generator&); 00750 #endif 00751 00752 template<typename _FIter, typename _Tp> 00753 void 00754 replace(_FIter, _FIter, const _Tp&, const _Tp&); 00755 00756 template<typename _FIter, typename _Predicate, typename _Tp> 00757 void 00758 replace_if(_FIter, _FIter, _Predicate, const _Tp&); 00759 00760 template<typename _FIter1, typename _FIter2> 00761 _FIter1 00762 search(_FIter1, _FIter1, _FIter2, _FIter2); 00763 00764 template<typename _FIter1, typename _FIter2, typename _BinaryPredicate> 00765 _FIter1 00766 search(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate); 00767 00768 template<typename _FIter, typename _Size, typename _Tp> 00769 _FIter 00770 search_n(_FIter, _FIter, _Size, const _Tp&); 00771 00772 template<typename _FIter, typename _Size, typename _Tp, 00773 typename _BinaryPredicate> 00774 _FIter 00775 search_n(_FIter, _FIter, _Size, const _Tp&, _BinaryPredicate); 00776 00777 template<typename _IIter1, typename _IIter2, typename _OIter> 00778 _OIter 00779 set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); 00780 00781 template<typename _IIter1, typename _IIter2, typename _OIter, 00782 typename _Compare> 00783 _OIter 00784 set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare); 00785 00786 template<typename _IIter1, typename _IIter2, typename _OIter> 00787 _OIter 00788 set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); 00789 00790 template<typename _IIter1, typename _IIter2, typename _OIter, 00791 typename _Compare> 00792 _OIter 00793 set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare); 00794 00795 template<typename _IIter1, typename _IIter2, typename _OIter> 00796 _OIter 00797 set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); 00798 00799 template<typename _IIter1, typename _IIter2, typename _OIter, 00800 typename _Compare> 00801 _OIter 00802 set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, 00803 _OIter, _Compare); 00804 00805 template<typename _IIter1, typename _IIter2, typename _OIter> 00806 _OIter 00807 set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter); 00808 00809 template<typename _IIter1, typename _IIter2, typename _OIter, 00810 typename _Compare> 00811 _OIter 00812 set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare); 00813 00814 template<typename _RAIter> 00815 void 00816 sort(_RAIter, _RAIter); 00817 00818 template<typename _RAIter, typename _Compare> 00819 void 00820 sort(_RAIter, _RAIter, _Compare); 00821 00822 template<typename _RAIter> 00823 void 00824 stable_sort(_RAIter, _RAIter); 00825 00826 template<typename _RAIter, typename _Compare> 00827 void 00828 stable_sort(_RAIter, _RAIter, _Compare); 00829 00830 template<typename _IIter, typename _OIter, typename _UnaryOperation> 00831 _OIter 00832 transform(_IIter, _IIter, _OIter, _UnaryOperation); 00833 00834 template<typename _IIter1, typename _IIter2, typename _OIter, 00835 typename _BinaryOperation> 00836 _OIter 00837 transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation); 00838 00839 template<typename _IIter, typename _OIter> 00840 _OIter 00841 unique_copy(_IIter, _IIter, _OIter); 00842 00843 template<typename _IIter, typename _OIter, typename _BinaryPredicate> 00844 _OIter 00845 unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate); 00846 00847 _GLIBCXX_END_NAMESPACE_ALGO 00848 } // namespace std 00849 00850 #ifdef _GLIBCXX_PARALLEL 00851 # include <parallel/algorithmfwd.h> 00852 #endif 00853 00854 #endif 00855