ReactOS  0.4.14-dev-606-g14ebc0b
_algo.c File Reference
#include <stl/_algo.h>
#include <stl/_tempbuf.h>
Include dependency graph for _algo.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _STLP_ALGO_C
 
#define __stl_threshold   16
 

Functions

template<class _BidirectionalIter , class _Distance , class _Compare >
_STLP_BEGIN_NAMESPACE _STLP_MOVE_TO_PRIV_NAMESPACE void __merge_without_buffer (_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Compare __comp)
 
template<class _BidirectionalIter1 , class _BidirectionalIter2 , class _BidirectionalIter3 , class _Compare >
_BidirectionalIter3 __merge_backward (_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, _BidirectionalIter3 __result, _Compare __comp)
 
template<class _Tp >
const _Tp & __median (const _Tp &__a, const _Tp &__b, const _Tp &__c)
 
template<class _Tp , class _Compare >
const _Tp & __median (const _Tp &__a, const _Tp &__b, const _Tp &__c, _Compare __comp)
 
template<class _ForwardIter1 , class _ForwardIter2 >
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter1 search (_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2)
 
template<class _RandomAccessIter , class _Integer , class _Tp , class _BinaryPred , class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __search_n (_RandomAccessIter __first, _RandomAccessIter __last, _Integer __count, const _Tp &__val, _BinaryPred __pred, _Distance *, const random_access_iterator_tag &)
 
template<class _ForwardIter , class _Integer , class _Tp , class _Distance , class _BinaryPred >
_ForwardIter __search_n (_ForwardIter __first, _ForwardIter __last, _Integer __count, const _Tp &__val, _BinaryPred __pred, _Distance *, const forward_iterator_tag &)
 
template<class _ForwardIter , class _Integer , class _Tp >
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter search_n (_ForwardIter __first, _ForwardIter __last, _Integer __count, const _Tp &__val)
 
template<class _ForwardIter , class _Integer , class _Tp , class _BinaryPred >
_ForwardIter search_n (_ForwardIter __first, _ForwardIter __last, _Integer __count, const _Tp &__val, _BinaryPred __binary_pred)
 
template<class _ForwardIter1 , class _ForwardIter2 >
_ForwardIter1 find_end (_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2)
 
template<class _InputIterator , class _OutputIterator , class _BinaryPredicate , class _Tp >
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _OutputIterator __unique_copy (_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __binary_pred, _Tp *)
 
template<class _InputIter , class _OutputIter , class _BinaryPredicate >
_OutputIter __unique_copy (_InputIter __first, _InputIter __last, _OutputIter __result, _BinaryPredicate __binary_pred, const output_iterator_tag &)
 
template<class _InputIter , class _ForwardIter , class _BinaryPredicate >
_STLP_INLINE_LOOP _ForwardIter __unique_copy (_InputIter __first, _InputIter __last, _ForwardIter __result, _BinaryPredicate __binary_pred, const forward_iterator_tag &)
 
template<class _InputIter , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter unique_copy (_InputIter __first, _InputIter __last, _OutputIter __result)
 
template<class _InputIter , class _OutputIter , class _BinaryPredicate >
_OutputIter unique_copy (_InputIter __first, _InputIter __last, _OutputIter __result, _BinaryPredicate __binary_pred)
 
template<class _ForwardIter , class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __rotate_aux (_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last, _Distance *, const forward_iterator_tag &)
 
template<class _BidirectionalIter , class _Distance >
_BidirectionalIter __rotate_aux (_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance *, const bidirectional_iterator_tag &)
 
template<class _EuclideanRingElement >
_STLP_INLINE_LOOP _EuclideanRingElement __gcd (_EuclideanRingElement __m, _EuclideanRingElement __n)
 
template<class _RandomAccessIter , class _Distance , class _Tp >
_RandomAccessIter __rotate_aux (_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last, _Distance *, _Tp *)
 
template<class _RandomAccessIter , class _Distance >
_RandomAccessIter __rotate_aux (_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last, _Distance *__dis, const random_access_iterator_tag &)
 
template<class _ForwardIter >
_ForwardIter __rotate (_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
 
template<class _ForwardIter >
_STLP_MOVE_TO_STD_NAMESPACE void rotate (_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
 
template<class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _Distance __random_number (_Distance __n)
 
template<class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE void random_shuffle (_RandomAccessIter __first, _RandomAccessIter __last)
 
template<class _RandomAccessIter , class _RandomNumberGenerator >
void random_shuffle (_RandomAccessIter __first, _RandomAccessIter __last, _RandomNumberGenerator &__rand)
 
template<class _ForwardIter , class _OutputIter , class _Distance >
_OutputIter random_sample_n (_ForwardIter __first, _ForwardIter __last, _OutputIter __out_ite, const _Distance __n)
 
template<class _ForwardIter , class _OutputIter , class _Distance , class _RandomNumberGenerator >
_OutputIter random_sample_n (_ForwardIter __first, _ForwardIter __last, _OutputIter __out_ite, const _Distance __n, _RandomNumberGenerator &__rand)
 
template<class _InputIter , class _RandomAccessIter , class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __random_sample (_InputIter __first, _InputIter __last, _RandomAccessIter __out_ite, const _Distance __n)
 
template<class _InputIter , class _RandomAccessIter , class _RandomNumberGenerator , class _Distance >
_RandomAccessIter __random_sample (_InputIter __first, _InputIter __last, _RandomAccessIter __out_ite, _RandomNumberGenerator &__rand, const _Distance __n)
 
template<class _InputIter , class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE _RandomAccessIter random_sample (_InputIter __first, _InputIter __last, _RandomAccessIter __out_first, _RandomAccessIter __out_last)
 
template<class _InputIter , class _RandomAccessIter , class _RandomNumberGenerator >
_RandomAccessIter random_sample (_InputIter __first, _InputIter __last, _RandomAccessIter __out_first, _RandomAccessIter __out_last, _RandomNumberGenerator &__rand)
 
template<class _ForwardIter , class _Predicate >
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _ForwardIter __partition (_ForwardIter __first, _ForwardIter __last, _Predicate __pred, const forward_iterator_tag &)
 
template<class _BidirectionalIter , class _Predicate >
_STLP_INLINE_LOOP _BidirectionalIter __partition (_BidirectionalIter __first, _BidirectionalIter __last, _Predicate __pred, const bidirectional_iterator_tag &)
 
template<class _ForwardIter , class _Predicate >
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter partition (_ForwardIter __first, _ForwardIter __last, _Predicate __pred)
 
template<class _ForwardIter , class _Predicate , class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __inplace_stable_partition (_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Distance __len, bool __pred_of_first, bool __pred_of_before_last)
 
template<class _ForwardIter , class _Pointer , class _Predicate , class _Distance >
_ForwardIter __stable_partition_adaptive (_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Distance __len, _Pointer __buffer, _Distance __buffer_size, bool __pred_of_first, bool __pred_of_before_last)
 
template<class _ForwardIter , class _Predicate , class _Tp , class _Distance >
_ForwardIter __stable_partition_aux_aux (_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Tp *, _Distance *, bool __pred_of_before_last)
 
template<class _ForwardIter , class _Predicate >
_ForwardIter __stable_partition_aux (_ForwardIter __first, _ForwardIter __last, _Predicate __pred, const forward_iterator_tag &)
 
template<class _BidirectIter , class _Predicate >
_BidirectIter __stable_partition_aux (_BidirectIter __first, _BidirectIter __last, _Predicate __pred, const bidirectional_iterator_tag &)
 
template<class _ForwardIter , class _Predicate >
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter stable_partition (_ForwardIter __first, _ForwardIter __last, _Predicate __pred)
 
template<class _RandomAccessIter , class _Tp , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __unguarded_partition (_RandomAccessIter __first, _RandomAccessIter __last, _Tp __pivot, _Compare __comp)
 
template<class _RandomAccessIter , class _Tp , class _Compare >
void __unguarded_linear_insert (_RandomAccessIter __last, _Tp __val, _Compare __comp)
 
template<class _RandomAccessIter , class _Tp , class _Compare >
void __linear_insert (_RandomAccessIter __first, _RandomAccessIter __last, _Tp __val, _Compare __comp)
 
template<class _RandomAccessIter , class _Tp , class _Compare >
void __insertion_sort (_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Compare __comp)
 
template<class _RandomAccessIter , class _Tp , class _Compare >
void __unguarded_insertion_sort_aux (_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Compare __comp)
 
template<class _RandomAccessIter , class _Compare >
void __unguarded_insertion_sort (_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
 
template<class _RandomAccessIter , class _Compare >
void __final_insertion_sort (_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
 
template<class _RandomAccessIter , class _Tp , class _Size , class _Compare >
void __introsort_loop (_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Size __depth_limit, _Compare __comp)
 
template<class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE void sort (_RandomAccessIter __first, _RandomAccessIter __last)
 
template<class _RandomAccessIter , class _Compare >
void sort (_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
 
template<class _RandomAccessIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE void __inplace_stable_sort (_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
 
template<class _RandomAccessIter1 , class _RandomAccessIter2 , class _Distance , class _Compare >
void __merge_sort_loop (_RandomAccessIter1 __first, _RandomAccessIter1 __last, _RandomAccessIter2 __result, _Distance __step_size, _Compare __comp)
 
template<class _RandomAccessIter , class _Distance , class _Compare >
void __chunk_insertion_sort (_RandomAccessIter __first, _RandomAccessIter __last, _Distance __chunk_size, _Compare __comp)
 
template<class _RandomAccessIter , class _Pointer , class _Distance , class _Compare >
void __merge_sort_with_buffer (_RandomAccessIter __first, _RandomAccessIter __last, _Pointer __buffer, _Distance *, _Compare __comp)
 
template<class _BidirectionalIter1 , class _BidirectionalIter2 , class _Distance >
_BidirectionalIter1 __rotate_adaptive (_BidirectionalIter1 __first, _BidirectionalIter1 __middle, _BidirectionalIter1 __last, _Distance __len1, _Distance __len2, _BidirectionalIter2 __buffer, _Distance __buffer_size)
 
template<class _BidirectionalIter , class _Distance , class _Pointer , class _Compare >
void __merge_adaptive (_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Pointer __buffer, _Distance __buffer_size, _Compare __comp)
 
template<class _RandomAccessIter , class _Pointer , class _Distance , class _Compare >
void __stable_sort_adaptive (_RandomAccessIter __first, _RandomAccessIter __last, _Pointer __buffer, _Distance __buffer_size, _Compare __comp)
 
template<class _RandomAccessIter , class _Tp , class _Distance , class _Compare >
void __stable_sort_aux (_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Distance *, _Compare __comp)
 
template<class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE void stable_sort (_RandomAccessIter __first, _RandomAccessIter __last)
 
template<class _RandomAccessIter , class _Compare >
void stable_sort (_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
 
template<class _RandomAccessIter , class _Tp , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE void __partial_sort (_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last, _Tp *, _Compare __comp)
 
template<class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE void partial_sort (_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last)
 
template<class _RandomAccessIter , class _Compare >
void partial_sort (_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last, _Compare __comp)
 
template<class _InputIter , class _RandomAccessIter , class _Compare , class _Distance , class _Tp >
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __partial_sort_copy (_InputIter __first, _InputIter __last, _RandomAccessIter __result_first, _RandomAccessIter __result_last, _Compare __comp, _Distance *, _Tp *)
 
template<class _InputIter , class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE _RandomAccessIter partial_sort_copy (_InputIter __first, _InputIter __last, _RandomAccessIter __result_first, _RandomAccessIter __result_last)
 
template<class _InputIter , class _RandomAccessIter , class _Compare >
_RandomAccessIter partial_sort_copy (_InputIter __first, _InputIter __last, _RandomAccessIter __result_first, _RandomAccessIter __result_last, _Compare __comp)
 
template<class _RandomAccessIter , class _Tp , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE void __nth_element (_RandomAccessIter __first, _RandomAccessIter __nth, _RandomAccessIter __last, _Tp *, _Compare __comp)
 
template<class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE void nth_element (_RandomAccessIter __first, _RandomAccessIter __nth, _RandomAccessIter __last)
 
template<class _RandomAccessIter , class _Compare >
void nth_element (_RandomAccessIter __first, _RandomAccessIter __nth, _RandomAccessIter __last, _Compare __comp)
 
template<class _ForwardIter , class _Tp , class _Compare1 , class _Compare2 , class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __upper_bound (_ForwardIter __first, _ForwardIter __last, const _Tp &__val, _Compare1 __comp1, _Compare2 __comp2, _Distance *)
 
template<class _ForwardIter , class _Tp , class _Compare1 , class _Compare2 , class _Distance >
pair< _ForwardIter, _ForwardIter > __equal_range (_ForwardIter __first, _ForwardIter __last, const _Tp &__val, _Compare1 __comp1, _Compare2 __comp2, _Distance *__dist)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter merge (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_OutputIter merge (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
 
template<class _BidirectionalIter , class _Distance , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE void __merge_without_buffer (_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Compare __comp)
 
template<class _BidirectionalIter , class _Tp , class _Distance , class _Compare >
void __inplace_merge_aux (_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Tp *, _Distance *, _Compare __comp)
 
template<class _BidirectionalIter >
_STLP_MOVE_TO_STD_NAMESPACE void inplace_merge (_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last)
 
template<class _BidirectionalIter , class _Compare >
void inplace_merge (_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Compare __comp)
 
template<class _InputIter1 , class _InputIter2 , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE bool __includes (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _Compare __comp)
 
template<class _InputIter1 , class _InputIter2 , class _Compare >
_STLP_MOVE_TO_STD_NAMESPACE bool includes (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _Compare __comp)
 
template<class _InputIter1 , class _InputIter2 >
bool includes (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_union (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_union (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_OutputIter set_union (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_intersection (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_intersection (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_OutputIter set_intersection (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_difference (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_difference (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_OutputIter set_difference (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_symmetric_difference (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_symmetric_difference (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
 
template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_OutputIter set_symmetric_difference (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
 
template<class _ForwardIter >
_ForwardIter max_element (_ForwardIter __first, _ForwardIter __last)
 
template<class _ForwardIter , class _Compare >
_ForwardIter max_element (_ForwardIter __first, _ForwardIter __last, _Compare __comp)
 
template<class _ForwardIter >
_ForwardIter min_element (_ForwardIter __first, _ForwardIter __last)
 
template<class _ForwardIter , class _Compare >
_ForwardIter min_element (_ForwardIter __first, _ForwardIter __last, _Compare __comp)
 
template<class _BidirectionalIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE bool __next_permutation (_BidirectionalIter __first, _BidirectionalIter __last, _Compare __comp)
 
template<class _BidirectionalIter >
_STLP_MOVE_TO_STD_NAMESPACE bool next_permutation (_BidirectionalIter __first, _BidirectionalIter __last)
 
template<class _BidirectionalIter , class _Compare >
bool next_permutation (_BidirectionalIter __first, _BidirectionalIter __last, _Compare __comp)
 
template<class _BidirectionalIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE bool __prev_permutation (_BidirectionalIter __first, _BidirectionalIter __last, _Compare __comp)
 
template<class _BidirectionalIter >
_STLP_MOVE_TO_STD_NAMESPACE bool prev_permutation (_BidirectionalIter __first, _BidirectionalIter __last)
 
template<class _BidirectionalIter , class _Compare >
bool prev_permutation (_BidirectionalIter __first, _BidirectionalIter __last, _Compare __comp)
 
template<class _RandomAccessIter , class _Distance , class _StrictWeakOrdering >
_STLP_MOVE_TO_PRIV_NAMESPACE bool __is_heap (_RandomAccessIter __first, _StrictWeakOrdering __comp, _Distance __n)
 
template<class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE bool is_heap (_RandomAccessIter __first, _RandomAccessIter __last)
 
template<class _RandomAccessIter , class _StrictWeakOrdering >
bool is_heap (_RandomAccessIter __first, _RandomAccessIter __last, _StrictWeakOrdering __comp)
 
template<class _ForwardIter , class _StrictWeakOrdering >
_STLP_MOVE_TO_PRIV_NAMESPACE bool __is_sorted (_ForwardIter __first, _ForwardIter __last, _StrictWeakOrdering __comp)
 

Variables

const int __stl_chunk_size = 7
 

Macro Definition Documentation

◆ __stl_threshold

#define __stl_threshold   16

Definition at line 904 of file _algo.c.

◆ _STLP_ALGO_C

#define _STLP_ALGO_C

Definition at line 27 of file _algo.c.

Function Documentation

◆ __chunk_insertion_sort()

template<class _RandomAccessIter , class _Distance , class _Compare >
void __chunk_insertion_sort ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Distance  __chunk_size,
_Compare  __comp 
)

Definition at line 1061 of file _algo.c.

1063  {
1064  while (__last - __first >= __chunk_size) {
1065  __insertion_sort(__first, __first + __chunk_size,
1066  _STLP_VALUE_TYPE(__first,_RandomAccessIter), __comp);
1067  __first += __chunk_size;
1068  }
1069  __insertion_sort(__first, __last, _STLP_VALUE_TYPE(__first,_RandomAccessIter), __comp);
1070 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
void __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Compare __comp)
Definition: _algo.c:935

Referenced by __merge_sort_with_buffer().

◆ __equal_range()

template<class _ForwardIter , class _Tp , class _Compare1 , class _Compare2 , class _Distance >
pair<_ForwardIter, _ForwardIter> __equal_range ( _ForwardIter  __first,
_ForwardIter  __last,
const _Tp &  __val,
_Compare1  __comp1,
_Compare2  __comp2,
_Distance *  __dist 
)

Definition at line 1381 of file _algo.c.

1382  {
1383  _Distance __len = _STLP_STD::distance(__first, __last);
1384  _Distance __half;
1385 
1386  while (__len > 0) {
1387  __half = __len >> 1;
1388  _ForwardIter __middle = __first;
1389  _STLP_STD::advance(__middle, __half);
1390  if (__comp1(*__middle, __val)) {
1391  _STLP_VERBOSE_ASSERT(!__comp2(__val, *__middle), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1392  __first = __middle;
1393  ++__first;
1394  __len = __len - __half - 1;
1395  }
1396  else if (__comp2(__val, *__middle)) {
1397  _STLP_VERBOSE_ASSERT(!__comp1(*__middle, __val), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1398  __len = __half;
1399  }
1400  else {
1401  _ForwardIter __left = _STLP_PRIV __lower_bound(__first, __middle, __val, __comp1, __comp2, __dist);
1402  //Small optim: If lower_bound haven't found an equivalent value
1403  //there is no need to call upper_bound.
1404  if (__comp1(*__left, __val)) {
1405  _STLP_VERBOSE_ASSERT(!__comp2(__val, *__left), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1406  return pair<_ForwardIter, _ForwardIter>(__left, __left);
1407  }
1408  _STLP_STD::advance(__first, __len);
1409  _ForwardIter __right = _STLP_PRIV __upper_bound(++__middle, __first, __val, __comp1, __comp2, __dist);
1410  return pair<_ForwardIter, _ForwardIter>(__left, __right);
1411  }
1412  }
1413  return pair<_ForwardIter, _ForwardIter>(__first, __first);
1414 }
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp &__val, _Compare1 __comp1, _Compare2 __comp2, _Distance *)
Definition: _algobase.c:453
GLsizei GLsizei GLfloat distance
Definition: glext.h:11755
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656
#define _STLP_PRIV
Definition: _dm.h:70
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
Definition: _pair.h:47
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp &__val, _Compare1 __comp1, _Compare2 __comp2, _Distance *)
Definition: _algo.c:1356
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by equal_range().

◆ __final_insertion_sort()

template<class _RandomAccessIter , class _Compare >
void __final_insertion_sort ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Compare  __comp 
)

Definition at line 959 of file _algo.c.

960  {
961  if (__last - __first > __stl_threshold) {
962  __insertion_sort(__first, __first + __stl_threshold, _STLP_VALUE_TYPE(__first,_RandomAccessIter), __comp);
964  }
965  else
966  __insertion_sort(__first, __last, _STLP_VALUE_TYPE(__first,_RandomAccessIter), __comp);
967 }
#define __stl_threshold
Definition: _algo.c:904
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
void __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Compare __comp)
Definition: _algo.c:935
void __unguarded_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
Definition: _algo.c:952

Referenced by sort().

◆ __gcd()

template<class _EuclideanRingElement >
_STLP_INLINE_LOOP _EuclideanRingElement __gcd ( _EuclideanRingElement  __m,
_EuclideanRingElement  __n 
)

Definition at line 432 of file _algo.c.

433  {
434  while (__n != 0) {
435  _EuclideanRingElement __t = __m % __n;
436  __m = __n;
437  __n = __t;
438  }
439  return __m;
440 }
return __n
Definition: _algo.h:75

Referenced by __rotate_aux().

◆ __includes()

template<class _InputIter1 , class _InputIter2 , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE bool __includes ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_Compare  __comp 
)

Definition at line 1581 of file _algo.c.

1582  {
1583  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
1584  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
1585  while (__first1 != __last1 && __first2 != __last2)
1586  if (__comp(*__first2, *__first1)) {
1587  _STLP_VERBOSE_ASSERT(!__comp(*__first1, *__first2), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1588  return false;
1589  }
1590  else if (__comp(*__first1, *__first2))
1591  ++__first1;
1592  else
1593  ++__first1, ++__first2;
1594 
1595  return __first2 == __last2;
1596 }
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by includes().

◆ __inplace_merge_aux()

template<class _BidirectionalIter , class _Tp , class _Distance , class _Compare >
void __inplace_merge_aux ( _BidirectionalIter  __first,
_BidirectionalIter  __middle,
_BidirectionalIter  __last,
_Tp *  ,
_Distance *  ,
_Compare  __comp 
)
inline

Definition at line 1534 of file _algo.c.

1537  {
1538  _Distance __len1 = _STLP_STD::distance(__first, __middle);
1539  _Distance __len2 = _STLP_STD::distance(__middle, __last);
1540 
1542  if (__buf.begin() == 0)
1543  __merge_without_buffer(__first, __middle, __last, __len1, __len2, __comp);
1544  else
1545  __merge_adaptive(__first, __middle, __last, __len1, __len2,
1546  __buf.begin(), _Distance(__buf.size()),
1547  __comp);
1548 }
GLsizei GLsizei GLfloat distance
Definition: glext.h:11755
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_BEGIN_NAMESPACE _STLP_MOVE_TO_PRIV_NAMESPACE void __merge_without_buffer(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Compare __comp)
Definition: _algo.c:1463
void __merge_adaptive(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Pointer __buffer, _Distance __buffer_size, _Compare __comp)
Definition: _algo.c:1115

Referenced by inplace_merge().

◆ __inplace_stable_partition()

template<class _ForwardIter , class _Predicate , class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __inplace_stable_partition ( _ForwardIter  __first,
_ForwardIter  __last,
_Predicate  __pred,
_Distance  __len,
bool  __pred_of_first,
bool  __pred_of_before_last 
)

Definition at line 752 of file _algo.c.

755  {
756  if (__len == 1)
757  return (__pred_of_first && (__pred_of_before_last || __pred(*__first))) ? __last : __first;
758  _ForwardIter __middle = __first;
759  _Distance __half_len = __len / 2;
760  _STLP_STD::advance(__middle, __half_len);
761  return _STLP_PRIV __rotate(_STLP_PRIV __inplace_stable_partition(__first, __middle, __pred, __half_len, __pred_of_first, false),
762  __middle,
763  _STLP_PRIV __inplace_stable_partition(__middle, __last, __pred, __len - __half_len, true, __pred_of_before_last));
764 }
_STLP_INLINE_LOOP _InputIter _Predicate __pred
Definition: _algo.h:68
_ForwardIter __rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
Definition: _algo.c:508
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __inplace_stable_partition(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Distance __len, bool __pred_of_first, bool __pred_of_before_last)
Definition: _algo.c:752
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)

Referenced by __stable_partition_aux_aux().

◆ __inplace_stable_sort()

template<class _RandomAccessIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE void __inplace_stable_sort ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Compare  __comp 
)

Definition at line 1020 of file _algo.c.

1021  {
1022  if (__last - __first < 15) {
1023  __insertion_sort(__first, __last, _STLP_VALUE_TYPE(__first,_RandomAccessIter), __comp);
1024  return;
1025  }
1026  _RandomAccessIter __middle = __first + (__last - __first) / 2;
1027  __inplace_stable_sort(__first, __middle, __comp);
1028  __inplace_stable_sort(__middle, __last, __comp);
1029  __merge_without_buffer(__first, __middle, __last,
1030  __middle - __first,
1031  __last - __middle,
1032  __comp);
1033 }
_STLP_MOVE_TO_PRIV_NAMESPACE void __inplace_stable_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
Definition: _algo.c:1020
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_BEGIN_NAMESPACE _STLP_MOVE_TO_PRIV_NAMESPACE void __merge_without_buffer(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Compare __comp)
Definition: _algo.c:1463
#define _STLP_VALUE_TYPE(_It, _Tp)
void __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Compare __comp)
Definition: _algo.c:935

Referenced by __stable_sort_aux().

◆ __insertion_sort()

template<class _RandomAccessIter , class _Tp , class _Compare >
void __insertion_sort ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Tp *  ,
_Compare  __comp 
)

Definition at line 935 of file _algo.c.

937  {
938  if (__first == __last) return;
939  for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
940  __linear_insert<_RandomAccessIter, _Tp, _Compare>(__first, __i, *__i, __comp); //*TY 12/26/1998 - supply *__i as __val
941 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68

Referenced by __chunk_insertion_sort(), __final_insertion_sort(), __inplace_stable_sort(), and __nth_element().

◆ __introsort_loop()

template<class _RandomAccessIter , class _Tp , class _Size , class _Compare >
void __introsort_loop ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Tp *  ,
_Size  __depth_limit,
_Compare  __comp 
)

Definition at line 970 of file _algo.c.

972  {
973  while (__last - __first > __stl_threshold) {
974  if (__depth_limit == 0) {
975  partial_sort(__first, __last, __last, __comp);
976  return;
977  }
978  --__depth_limit;
979  _RandomAccessIter __cut =
980  __unguarded_partition(__first, __last,
981  _Tp(__median(*__first,
982  *(__first + (__last - __first)/2),
983  *(__last - 1), __comp)),
984  __comp);
985  __introsort_loop(__cut, __last, (_Tp*) 0, __depth_limit, __comp);
986  __last = __cut;
987  }
988 }
void __introsort_loop(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Size __depth_limit, _Compare __comp)
Definition: _algo.c:970
#define __stl_threshold
Definition: _algo.c:904
_STLP_MOVE_TO_STD_NAMESPACE void partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last)
Definition: _algo.c:1236
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __unguarded_partition(_RandomAccessIter __first, _RandomAccessIter __last, _Tp __pivot, _Compare __comp)
Definition: _algo.c:883
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
const _Tp & __median(const _Tp &__a, const _Tp &__b, const _Tp &__c)
Definition: _algo.c:62

Referenced by sort().

◆ __is_heap()

template<class _RandomAccessIter , class _Distance , class _StrictWeakOrdering >
_STLP_MOVE_TO_PRIV_NAMESPACE bool __is_heap ( _RandomAccessIter  __first,
_StrictWeakOrdering  __comp,
_Distance  __n 
)

Definition at line 1968 of file _algo.c.

1969  {
1970  _Distance __parent = 0;
1971  for (_Distance __child = 1; __child < __n; ++__child) {
1972  if (__comp(__first[__parent], __first[__child])) {
1973  _STLP_VERBOSE_ASSERT(!__comp(__first[__child], __first[__parent]), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1974  return false;
1975  }
1976  if ((__child & 1) == 0)
1977  ++__parent;
1978  }
1979  return true;
1980 }
return __n
Definition: _algo.h:75
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by is_heap().

◆ __is_sorted()

template<class _ForwardIter , class _StrictWeakOrdering >
_STLP_MOVE_TO_PRIV_NAMESPACE bool __is_sorted ( _ForwardIter  __first,
_ForwardIter  __last,
_StrictWeakOrdering  __comp 
)

Definition at line 2001 of file _algo.c.

2002  {
2003  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
2004  if (__first == __last)
2005  return true;
2006 
2007  _ForwardIter __next = __first;
2008  for (++__next; __next != __last; __first = __next, ++__next) {
2009  if (__comp(*__next, *__first)) {
2010  _STLP_VERBOSE_ASSERT(!__comp(*__first, *__next), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
2011  return false;
2012  }
2013  }
2014 
2015  return true;
2016 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by is_sorted().

◆ __linear_insert()

template<class _RandomAccessIter , class _Tp , class _Compare >
void __linear_insert ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Tp  __val,
_Compare  __comp 
)
inline

Definition at line 921 of file _algo.c.

922  {
923  //*TY 12/26/1998 - added __val as a paramter
924  // _Tp __val = *__last; //*TY 12/26/1998 - __val supplied by caller
925  if (__comp(__val, *__first)) {
926  _STLP_VERBOSE_ASSERT(!__comp(*__first, __val), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
927  copy_backward(__first, __last, __last + 1);
928  *__first = __val;
929  }
930  else
932 }
void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val, _Compare __comp)
Definition: _algo.c:907
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter copy_backward(_InputIter __first, _InputIter __last, _OutputIter __result)
Definition: _algobase.h:328
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

◆ __median() [1/2]

template<class _Tp >
const _Tp& __median ( const _Tp &  __a,
const _Tp &  __b,
const _Tp &  __c 
)
inline

Definition at line 62 of file _algo.c.

62  {
63  if (__a < __b)
64  if (__b < __c)
65  return __b;
66  else if (__a < __c)
67  return __c;
68  else
69  return __a;
70  else if (__a < __c)
71  return __a;
72  else if (__b < __c)
73  return __c;
74  else
75  return __b;
76 }
#define __c
Definition: schilyio.h:209

Referenced by __introsort_loop(), and __nth_element().

◆ __median() [2/2]

template<class _Tp , class _Compare >
const _Tp& __median ( const _Tp &  __a,
const _Tp &  __b,
const _Tp &  __c,
_Compare  __comp 
)
inline

Definition at line 83 of file _algo.c.

83  {
84  if (__comp(__a, __b)) {
85  _STLP_VERBOSE_ASSERT(!__comp(__b, __a), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
86  if (__comp(__b, __c)) {
87  _STLP_VERBOSE_ASSERT(!__comp(__c, __b), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
88  return __b;
89  }
90  else if (__comp(__a, __c)) {
91  _STLP_VERBOSE_ASSERT(!__comp(__c, __a), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
92  return __c;
93  }
94  else
95  return __a;
96  }
97  else if (__comp(__a, __c)) {
98  _STLP_VERBOSE_ASSERT(!__comp(__c, __a), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
99  return __a;
100  }
101  else if (__comp(__b, __c)) {
102  _STLP_VERBOSE_ASSERT(!__comp(__c, __b), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
103  return __c;
104  }
105  else
106  return __b;
107 }
#define __c
Definition: schilyio.h:209
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

◆ __merge_adaptive()

template<class _BidirectionalIter , class _Distance , class _Pointer , class _Compare >
void __merge_adaptive ( _BidirectionalIter  __first,
_BidirectionalIter  __middle,
_BidirectionalIter  __last,
_Distance  __len1,
_Distance  __len2,
_Pointer  __buffer,
_Distance  __buffer_size,
_Compare  __comp 
)

Definition at line 1115 of file _algo.c.

1120  {
1121  if (__len1 <= __len2 && __len1 <= __buffer_size) {
1122  _Pointer __buffer_end = _STLP_STD::copy(__first, __middle, __buffer);
1123  _STLP_STD::merge(__buffer, __buffer_end, __middle, __last, __first, __comp);
1124  }
1125  else if (__len2 <= __buffer_size) {
1126  _Pointer __buffer_end = _STLP_STD::copy(__middle, __last, __buffer);
1127  _STLP_PRIV __merge_backward(__first, __middle, __buffer, __buffer_end, __last,
1128  __comp);
1129  }
1130  else {
1131  _BidirectionalIter __first_cut = __first;
1132  _BidirectionalIter __second_cut = __middle;
1133  _Distance __len11 = 0;
1134  _Distance __len22 = 0;
1135  if (__len1 > __len2) {
1136  __len11 = __len1 / 2;
1137  _STLP_STD::advance(__first_cut, __len11);
1138  __second_cut = _STLP_STD::lower_bound(__middle, __last, *__first_cut, __comp);
1139  __len22 += _STLP_STD::distance(__middle, __second_cut);
1140  }
1141  else {
1142  __len22 = __len2 / 2;
1143  _STLP_STD::advance(__second_cut, __len22);
1144  __first_cut = _STLP_STD::upper_bound(__first, __middle, *__second_cut, __comp);
1145  __len11 += _STLP_STD::distance(__first, __first_cut);
1146  }
1147  _BidirectionalIter __new_middle =
1148  __rotate_adaptive(__first_cut, __middle, __second_cut, __len1 - __len11,
1149  __len22, __buffer, __buffer_size);
1150  __merge_adaptive(__first, __first_cut, __new_middle, __len11,
1151  __len22, __buffer, __buffer_size, __comp);
1152  __merge_adaptive(__new_middle, __second_cut, __last, __len1 - __len11,
1153  __len2 - __len22, __buffer, __buffer_size, __comp);
1154  }
1155 }
GLsizei GLsizei GLfloat distance
Definition: glext.h:11755
_BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, _BidirectionalIter3 __result, _Compare __comp)
Definition: _algo.c:1503
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter merge(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
Definition: _algo.c:1419
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
Definition: _algo.h:481
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
void __merge_adaptive(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Pointer __buffer, _Distance __buffer_size, _Compare __comp)
Definition: _algo.c:1115
#define _STLP_PRIV
Definition: _dm.h:70
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
Definition: _algo.h:507
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
_BidirectionalIter1 __rotate_adaptive(_BidirectionalIter1 __first, _BidirectionalIter1 __middle, _BidirectionalIter1 __last, _Distance __len1, _Distance __len2, _BidirectionalIter2 __buffer, _Distance __buffer_size)
Definition: _algo.c:1093

Referenced by __inplace_merge_aux(), and __stable_sort_adaptive().

◆ __merge_backward()

template<class _BidirectionalIter1 , class _BidirectionalIter2 , class _BidirectionalIter3 , class _Compare >
_BidirectionalIter3 __merge_backward ( _BidirectionalIter1  __first1,
_BidirectionalIter1  __last1,
_BidirectionalIter2  __first2,
_BidirectionalIter2  __last2,
_BidirectionalIter3  __result,
_Compare  __comp 
)

Definition at line 1503 of file _algo.c.

1508  {
1509  if (__first1 == __last1)
1510  return copy_backward(__first2, __last2, __result);
1511  if (__first2 == __last2)
1512  return copy_backward(__first1, __last1, __result);
1513  --__last1;
1514  --__last2;
1515  for (;;) {
1516  if (__comp(*__last2, *__last1)) {
1517  _STLP_VERBOSE_ASSERT(!__comp(*__last1, *__last2), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1518  *--__result = *__last1;
1519  if (__first1 == __last1)
1520  return copy_backward(__first2, ++__last2, __result);
1521  --__last1;
1522  }
1523  else {
1524  *--__result = *__last2;
1525  if (__first2 == __last2)
1526  return copy_backward(__first1, ++__last1, __result);
1527  --__last2;
1528  }
1529  }
1530 }
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter copy_backward(_InputIter __first, _InputIter __last, _OutputIter __result)
Definition: _algobase.h:328
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by __merge_adaptive().

◆ __merge_sort_loop()

template<class _RandomAccessIter1 , class _RandomAccessIter2 , class _Distance , class _Compare >
void __merge_sort_loop ( _RandomAccessIter1  __first,
_RandomAccessIter1  __last,
_RandomAccessIter2  __result,
_Distance  __step_size,
_Compare  __comp 
)

Definition at line 1037 of file _algo.c.

1040  {
1041  _Distance __two_step = 2 * __step_size;
1042 
1043  while (__last - __first >= __two_step) {
1044  __result = merge(__first, __first + __step_size,
1045  __first + __step_size, __first + __two_step,
1046  __result,
1047  __comp);
1048  __first += __two_step;
1049  }
1050  __step_size = (min) (_Distance(__last - __first), __step_size);
1051 
1052  merge(__first, __first + __step_size,
1053  __first + __step_size, __last,
1054  __result,
1055  __comp);
1056 }
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter merge(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
Definition: _algo.c:1419
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define min(a, b)
Definition: monoChain.cc:55

Referenced by __merge_sort_with_buffer().

◆ __merge_sort_with_buffer()

template<class _RandomAccessIter , class _Pointer , class _Distance , class _Compare >
void __merge_sort_with_buffer ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Pointer  __buffer,
_Distance *  ,
_Compare  __comp 
)

Definition at line 1074 of file _algo.c.

1076  {
1077  _Distance __len = __last - __first;
1078  _Pointer __buffer_last = __buffer + __len;
1079 
1080  _Distance __step_size = __stl_chunk_size;
1081  __chunk_insertion_sort(__first, __last, __step_size, __comp);
1082 
1083  while (__step_size < __len) {
1084  __merge_sort_loop(__first, __last, __buffer, __step_size, __comp);
1085  __step_size *= 2;
1086  __merge_sort_loop(__buffer, __buffer_last, __first, __step_size, __comp);
1087  __step_size *= 2;
1088  }
1089 }
void __chunk_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Distance __chunk_size, _Compare __comp)
Definition: _algo.c:1061
const int __stl_chunk_size
Definition: _algo.c:1058
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
void __merge_sort_loop(_RandomAccessIter1 __first, _RandomAccessIter1 __last, _RandomAccessIter2 __result, _Distance __step_size, _Compare __comp)
Definition: _algo.c:1037

Referenced by __stable_sort_adaptive().

◆ __merge_without_buffer() [1/2]

template<class _BidirectionalIter , class _Distance , class _Compare >
_STLP_BEGIN_NAMESPACE _STLP_MOVE_TO_PRIV_NAMESPACE void __merge_without_buffer ( _BidirectionalIter  __first,
_BidirectionalIter  __middle,
_BidirectionalIter  __last,
_Distance  __len1,
_Distance  __len2,
_Compare  __comp 
)

Definition at line 1463 of file _algo.c.

1467  {
1468  if (__len1 == 0 || __len2 == 0)
1469  return;
1470  if (__len1 + __len2 == 2) {
1471  if (__comp(*__middle, *__first)) {
1472  _STLP_VERBOSE_ASSERT(!__comp(*__first, *__middle), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1473  iter_swap(__first, __middle);
1474  }
1475  return;
1476  }
1477  _BidirectionalIter __first_cut = __first;
1478  _BidirectionalIter __second_cut = __middle;
1479  _Distance __len11 = 0;
1480  _Distance __len22 = 0;
1481  if (__len1 > __len2) {
1482  __len11 = __len1 / 2;
1483  _STLP_STD::advance(__first_cut, __len11);
1484  __second_cut = _STLP_STD::lower_bound(__middle, __last, *__first_cut, __comp);
1485  __len22 += _STLP_STD::distance(__middle, __second_cut);
1486  }
1487  else {
1488  __len22 = __len2 / 2;
1489  _STLP_STD::advance(__second_cut, __len22);
1490  __first_cut = _STLP_STD::upper_bound(__first, __middle, *__second_cut, __comp);
1491  __len11 += _STLP_STD::distance(__first, __first_cut);
1492  }
1493  _BidirectionalIter __new_middle
1494  = _STLP_PRIV __rotate(__first_cut, __middle, __second_cut);
1495  __merge_without_buffer(__first, __first_cut, __new_middle, __len11, __len22,
1496  __comp);
1497  __merge_without_buffer(__new_middle, __second_cut, __last, __len1 - __len11,
1498  __len2 - __len22, __comp);
1499 }
GLsizei GLsizei GLfloat distance
Definition: glext.h:11755
_ForwardIter __rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
Definition: _algo.c:508
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
Definition: _algo.h:481
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_BEGIN_NAMESPACE _STLP_MOVE_TO_PRIV_NAMESPACE void __merge_without_buffer(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Compare __comp)
Definition: _algo.c:1463
#define _STLP_PRIV
Definition: _dm.h:70
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
Definition: _algo.h:507
_STLP_MOVE_TO_STD_NAMESPACE void iter_swap(_ForwardIter1 __i1, _ForwardIter2 __i2)
Definition: _algobase.h:120
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by __inplace_merge_aux(), __inplace_stable_sort(), and __merge_without_buffer().

◆ __merge_without_buffer() [2/2]

template<class _BidirectionalIter , class _Distance , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE void __merge_without_buffer ( _BidirectionalIter  __first,
_BidirectionalIter  __middle,
_BidirectionalIter  __last,
_Distance  __len1,
_Distance  __len2,
_Compare  __comp 
)

Definition at line 1463 of file _algo.c.

1467  {
1468  if (__len1 == 0 || __len2 == 0)
1469  return;
1470  if (__len1 + __len2 == 2) {
1471  if (__comp(*__middle, *__first)) {
1472  _STLP_VERBOSE_ASSERT(!__comp(*__first, *__middle), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1473  iter_swap(__first, __middle);
1474  }
1475  return;
1476  }
1477  _BidirectionalIter __first_cut = __first;
1478  _BidirectionalIter __second_cut = __middle;
1479  _Distance __len11 = 0;
1480  _Distance __len22 = 0;
1481  if (__len1 > __len2) {
1482  __len11 = __len1 / 2;
1483  _STLP_STD::advance(__first_cut, __len11);
1484  __second_cut = _STLP_STD::lower_bound(__middle, __last, *__first_cut, __comp);
1485  __len22 += _STLP_STD::distance(__middle, __second_cut);
1486  }
1487  else {
1488  __len22 = __len2 / 2;
1489  _STLP_STD::advance(__second_cut, __len22);
1490  __first_cut = _STLP_STD::upper_bound(__first, __middle, *__second_cut, __comp);
1491  __len11 += _STLP_STD::distance(__first, __first_cut);
1492  }
1493  _BidirectionalIter __new_middle
1494  = _STLP_PRIV __rotate(__first_cut, __middle, __second_cut);
1495  __merge_without_buffer(__first, __first_cut, __new_middle, __len11, __len22,
1496  __comp);
1497  __merge_without_buffer(__new_middle, __second_cut, __last, __len1 - __len11,
1498  __len2 - __len22, __comp);
1499 }
GLsizei GLsizei GLfloat distance
Definition: glext.h:11755
_ForwardIter __rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
Definition: _algo.c:508
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
Definition: _algo.h:481
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_BEGIN_NAMESPACE _STLP_MOVE_TO_PRIV_NAMESPACE void __merge_without_buffer(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Compare __comp)
Definition: _algo.c:1463
#define _STLP_PRIV
Definition: _dm.h:70
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
Definition: _algo.h:507
_STLP_MOVE_TO_STD_NAMESPACE void iter_swap(_ForwardIter1 __i1, _ForwardIter2 __i2)
Definition: _algobase.h:120
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by __inplace_merge_aux(), __inplace_stable_sort(), and __merge_without_buffer().

◆ __next_permutation()

template<class _BidirectionalIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE bool __next_permutation ( _BidirectionalIter  __first,
_BidirectionalIter  __last,
_Compare  __comp 
)

Definition at line 1860 of file _algo.c.

1861  {
1862  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1863  if (__first == __last)
1864  return false;
1865  _BidirectionalIter __i = __first;
1866  ++__i;
1867  if (__i == __last)
1868  return false;
1869  __i = __last;
1870  --__i;
1871 
1872  for(;;) {
1873  _BidirectionalIter __ii = __i;
1874  --__i;
1875  if (__comp(*__i, *__ii)) {
1876  _STLP_VERBOSE_ASSERT(!__comp(*__ii, *__i), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1877  _BidirectionalIter __j = __last;
1878  while (!__comp(*__i, *--__j)) {}
1879  iter_swap(__i, __j);
1880  reverse(__ii, __last);
1881  return true;
1882  }
1883  if (__i == __first) {
1884  reverse(__first, __last);
1885  return false;
1886  }
1887  }
1888 #if defined (_STLP_NEED_UNREACHABLE_RETURN)
1889  return false;
1890 #endif
1891 }
_STLP_MOVE_TO_STD_NAMESPACE void reverse(_BidirectionalIter __first, _BidirectionalIter __last)
Definition: _algo.h:332
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_STD_NAMESPACE void iter_swap(_ForwardIter1 __i1, _ForwardIter2 __i2)
Definition: _algobase.h:120
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by next_permutation().

◆ __nth_element()

template<class _RandomAccessIter , class _Tp , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE void __nth_element ( _RandomAccessIter  __first,
_RandomAccessIter  __nth,
_RandomAccessIter  __last,
_Tp *  ,
_Compare  __comp 
)

Definition at line 1314 of file _algo.c.

1315  {
1316  while (__last - __first > 3) {
1317  _RandomAccessIter __cut =
1318  __unguarded_partition(__first, __last,
1319  _Tp(__median(*__first,
1320  *(__first + (__last - __first)/2),
1321  *(__last - 1),
1322  __comp)),
1323  __comp);
1324  if (__cut <= __nth)
1325  __first = __cut;
1326  else
1327  __last = __cut;
1328  }
1329  __insertion_sort(__first, __last, _STLP_VALUE_TYPE(__first,_RandomAccessIter), __comp);
1330 }
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __unguarded_partition(_RandomAccessIter __first, _RandomAccessIter __last, _Tp __pivot, _Compare __comp)
Definition: _algo.c:883
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
const _Tp & __median(const _Tp &__a, const _Tp &__b, const _Tp &__c)
Definition: _algo.c:62
void __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Compare __comp)
Definition: _algo.c:935

Referenced by nth_element().

◆ __partial_sort()

template<class _RandomAccessIter , class _Tp , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE void __partial_sort ( _RandomAccessIter  __first,
_RandomAccessIter  __middle,
_RandomAccessIter  __last,
_Tp *  ,
_Compare  __comp 
)

Definition at line 1220 of file _algo.c.

1221  {
1222  make_heap(__first, __middle, __comp);
1223  for (_RandomAccessIter __i = __middle; __i < __last; ++__i) {
1224  if (__comp(*__i, *__first)) {
1225  _STLP_VERBOSE_ASSERT(!__comp(*__first, *__i), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1226  __pop_heap(__first, __middle, __i, _Tp(*__i), __comp,
1227  _STLP_DISTANCE_TYPE(__first, _RandomAccessIter));
1228  }
1229  }
1230  sort_heap(__first, __middle, __comp);
1231 }
_STLP_INLINE_LOOP void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
Definition: _heap.h:99
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
void __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _RandomAccessIterator __result, _Tp __val, _Distance *)
Definition: _heap.h:54
void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
Definition: _heap.c:206
#define _STLP_DISTANCE_TYPE(_It, _Tp)
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by partial_sort().

◆ __partial_sort_copy()

template<class _InputIter , class _RandomAccessIter , class _Compare , class _Distance , class _Tp >
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __partial_sort_copy ( _InputIter  __first,
_InputIter  __last,
_RandomAccessIter  __result_first,
_RandomAccessIter  __result_last,
_Compare  __comp,
_Distance *  ,
_Tp *   
)

Definition at line 1256 of file _algo.c.

1260  {
1261  if (__result_first == __result_last) return __result_last;
1262  _RandomAccessIter __result_real_last = __result_first;
1263  while(__first != __last && __result_real_last != __result_last) {
1264  *__result_real_last = *__first;
1265  ++__result_real_last;
1266  ++__first;
1267  }
1268  make_heap(__result_first, __result_real_last, __comp);
1269  while (__first != __last) {
1270  if (__comp(*__first, *__result_first)) {
1271  _STLP_VERBOSE_ASSERT(!__comp(*__result_first, *__first), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1272  __adjust_heap(__result_first, _Distance(0),
1273  _Distance(__result_real_last - __result_first),
1274  _Tp(*__first),
1275  __comp);
1276  }
1277  ++__first;
1278  }
1279  sort_heap(__result_first, __result_real_last, __comp);
1280  return __result_real_last;
1281 }
_STLP_INLINE_LOOP void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
Definition: _heap.h:99
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
void __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, _Distance __len, _Tp __val)
Definition: _heap.c:111
void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
Definition: _heap.c:206
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by partial_sort_copy().

◆ __partition() [1/2]

template<class _ForwardIter , class _Predicate >
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _ForwardIter __partition ( _ForwardIter  __first,
_ForwardIter  __last,
_Predicate  __pred,
const forward_iterator_tag  
)

Definition at line 676 of file _algo.c.

679  {
680  if (__first == __last) return __first;
681 
682  while (__pred(*__first))
683  if (++__first == __last) return __first;
684 
685  _ForwardIter __next = __first;
686 
687  while (++__next != __last) {
688  if (__pred(*__next)) {
689  _STLP_STD::swap(*__first, *__next);
690  ++__first;
691  }
692  }
693  return __first;
694 }
#define swap(a, b)
Definition: qsort.c:63
_STLP_INLINE_LOOP _InputIter _Predicate __pred
Definition: _algo.h:68
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68

Referenced by partition().

◆ __partition() [2/2]

template<class _BidirectionalIter , class _Predicate >
_STLP_INLINE_LOOP _BidirectionalIter __partition ( _BidirectionalIter  __first,
_BidirectionalIter  __last,
_Predicate  __pred,
const bidirectional_iterator_tag  
)

Definition at line 697 of file _algo.c.

700  {
701  for (;;) {
702  for (;;) {
703  if (__first == __last)
704  return __first;
705  else if (__pred(*__first))
706  ++__first;
707  else
708  break;
709  }
710  --__last;
711  for (;;) {
712  if (__first == __last)
713  return __first;
714  else if (!__pred(*__last))
715  --__last;
716  else
717  break;
718  }
719  iter_swap(__first, __last);
720  ++__first;
721  }
722 }
_STLP_INLINE_LOOP _InputIter _Predicate __pred
Definition: _algo.h:68
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_MOVE_TO_STD_NAMESPACE void iter_swap(_ForwardIter1 __i1, _ForwardIter2 __i2)
Definition: _algobase.h:120

◆ __prev_permutation()

template<class _BidirectionalIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE bool __prev_permutation ( _BidirectionalIter  __first,
_BidirectionalIter  __last,
_Compare  __comp 
)

Definition at line 1912 of file _algo.c.

1913  {
1914  if (__first == __last)
1915  return false;
1916  _BidirectionalIter __i = __first;
1917  ++__i;
1918  if (__i == __last)
1919  return false;
1920  __i = __last;
1921  --__i;
1922 
1923  for(;;) {
1924  _BidirectionalIter __ii = __i;
1925  --__i;
1926  if (__comp(*__ii, *__i)) {
1927  _STLP_VERBOSE_ASSERT(!__comp(*__i, *__ii), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1928  _BidirectionalIter __j = __last;
1929  while (!__comp(*--__j, *__i)) {}
1930  iter_swap(__i, __j);
1931  reverse(__ii, __last);
1932  return true;
1933  }
1934  if (__i == __first) {
1935  reverse(__first, __last);
1936  return false;
1937  }
1938  }
1939 #if defined (_STLP_NEED_UNREACHABLE_RETURN)
1940  return false;
1941 #endif
1942 }
_STLP_MOVE_TO_STD_NAMESPACE void reverse(_BidirectionalIter __first, _BidirectionalIter __last)
Definition: _algo.h:332
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_MOVE_TO_STD_NAMESPACE void iter_swap(_ForwardIter1 __i1, _ForwardIter2 __i2)
Definition: _algobase.h:120
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by prev_permutation().

◆ __random_number()

template<class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _Distance __random_number ( _Distance  __n)
inline

Definition at line 529 of file _algo.c.

529  {
530 #ifdef _STLP_NO_DRAND48
531  return rand() % __n;
532 #else
533  return lrand48() % __n;
534 #endif
535 }
return __n
Definition: _algo.h:75
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10

Referenced by __random_sample(), random_sample_n(), and random_shuffle().

◆ __random_sample() [1/2]

template<class _InputIter , class _RandomAccessIter , class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __random_sample ( _InputIter  __first,
_InputIter  __last,
_RandomAccessIter  __out_ite,
const _Distance  __n 
)

Definition at line 605 of file _algo.c.

607  {
608  _Distance __m = 0;
609  _Distance __t = __n;
610  for ( ; __first != __last && __m < __n; ++__m, ++__first)
611  __out_ite[__m] = *__first;
612 
613  while (__first != __last) {
614  ++__t;
615  _Distance __M = __random_number(__t);
616  if (__M < __n)
617  __out_ite[__M] = *__first;
618  ++__first;
619  }
620 
621  return __out_ite + __m;
622 }
return __n
Definition: _algo.h:75
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_MOVE_TO_PRIV_NAMESPACE _Distance __random_number(_Distance __n)
Definition: _algo.c:529

Referenced by random_sample().

◆ __random_sample() [2/2]

template<class _InputIter , class _RandomAccessIter , class _RandomNumberGenerator , class _Distance >
_RandomAccessIter __random_sample ( _InputIter  __first,
_InputIter  __last,
_RandomAccessIter  __out_ite,
_RandomNumberGenerator &  __rand,
const _Distance  __n 
)

Definition at line 626 of file _algo.c.

629  {
630  _Distance __m = 0;
631  _Distance __t = __n;
632  for ( ; __first != __last && __m < __n; ++__m, ++__first)
633  __out_ite[__m] = *__first;
634 
635  while (__first != __last) {
636  ++__t;
637  _Distance __M = __rand(__t);
638  if (__M < __n)
639  __out_ite[__M] = *__first;
640  ++__first;
641  }
642 
643  return __out_ite + __m;
644 }
return __n
Definition: _algo.h:75
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68

◆ __rotate()

template<class _ForwardIter >
_ForwardIter __rotate ( _ForwardIter  __first,
_ForwardIter  __middle,
_ForwardIter  __last 
)

Definition at line 508 of file _algo.c.

508  {
509  _STLP_DEBUG_CHECK(__check_range(__first, __middle))
510  _STLP_DEBUG_CHECK(__check_range(__middle, __last))
511  return __rotate_aux(__first, __middle, __last,
512  _STLP_DISTANCE_TYPE(__first, _ForwardIter),
513  _STLP_ITERATOR_CATEGORY(__first, _ForwardIter));
514 }
#define _STLP_ITERATOR_CATEGORY(_It, _Tp)
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __rotate_aux(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last, _Distance *, const forward_iterator_tag &)
Definition: _algo.c:370
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define _STLP_DISTANCE_TYPE(_It, _Tp)

Referenced by __inplace_stable_partition(), __merge_without_buffer(), __rotate_adaptive(), __stable_partition_adaptive(), and rotate().

◆ __rotate_adaptive()

template<class _BidirectionalIter1 , class _BidirectionalIter2 , class _Distance >
_BidirectionalIter1 __rotate_adaptive ( _BidirectionalIter1  __first,
_BidirectionalIter1  __middle,
_BidirectionalIter1  __last,
_Distance  __len1,
_Distance  __len2,
_BidirectionalIter2  __buffer,
_Distance  __buffer_size 
)

Definition at line 1093 of file _algo.c.

1098  {
1099  if (__len1 > __len2 && __len2 <= __buffer_size) {
1100  _BidirectionalIter2 __buffer_end = _STLP_STD::copy(__middle, __last, __buffer);
1101  _STLP_STD::copy_backward(__first, __middle, __last);
1102  return _STLP_STD::copy(__buffer, __buffer_end, __first);
1103  }
1104  else if (__len1 <= __buffer_size) {
1105  _BidirectionalIter2 __buffer_end = _STLP_STD::copy(__first, __middle, __buffer);
1106  _STLP_STD::copy(__middle, __last, __first);
1107  return _STLP_STD::copy_backward(__buffer, __buffer_end, __last);
1108  }
1109  else
1110  return _STLP_PRIV __rotate(__first, __middle, __last);
1111 }
_ForwardIter __rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
Definition: _algo.c:508
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter copy_backward(_InputIter __first, _InputIter __last, _OutputIter __result)
Definition: _algobase.h:328

Referenced by __merge_adaptive().

◆ __rotate_aux() [1/4]

template<class _ForwardIter , class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __rotate_aux ( _ForwardIter  __first,
_ForwardIter  __middle,
_ForwardIter  __last,
_Distance *  ,
const forward_iterator_tag  
)

Definition at line 370 of file _algo.c.

374  {
375  if (__first == __middle)
376  return __last;
377  if (__last == __middle)
378  return __first;
379 
380  _ForwardIter __first2 = __middle;
381  do {
382  _STLP_STD::swap(*__first++, *__first2++);
383  if (__first == __middle)
384  __middle = __first2;
385  } while (__first2 != __last);
386 
387  _ForwardIter __new_middle = __first;
388 
389  __first2 = __middle;
390 
391  while (__first2 != __last) {
392  _STLP_STD::swap (*__first++, *__first2++);
393  if (__first == __middle)
394  __middle = __first2;
395  else if (__first2 == __last)
396  __first2 = __middle;
397  }
398 
399  return __new_middle;
400 }
#define swap(a, b)
Definition: qsort.c:63
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68

Referenced by __rotate(), and __rotate_aux().

◆ __rotate_aux() [2/4]

template<class _BidirectionalIter , class _Distance >
_BidirectionalIter __rotate_aux ( _BidirectionalIter  __first,
_BidirectionalIter  __middle,
_BidirectionalIter  __last,
_Distance *  ,
const bidirectional_iterator_tag  
)

Definition at line 403 of file _algo.c.

407  {
408  if (__first == __middle)
409  return __last;
410  if (__last == __middle)
411  return __first;
412 
413  _STLP_PRIV __reverse(__first, __middle, bidirectional_iterator_tag());
415 
416  while (__first != __middle && __middle != __last)
417  _STLP_STD::swap(*__first++, *--__last);
418 
419  if (__first == __middle) {
421  return __last;
422  }
423  else {
424  _STLP_PRIV __reverse(__first, __middle, bidirectional_iterator_tag());
425  return __first;
426  }
427 }
#define bidirectional_iterator_tag
Definition: _abbrevs.h:27
#define swap(a, b)
Definition: qsort.c:63
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP void __reverse(_BidirectionalIter __first, _BidirectionalIter __last, const bidirectional_iterator_tag &)
Definition: _algo.h:316
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70

◆ __rotate_aux() [3/4]

template<class _RandomAccessIter , class _Distance , class _Tp >
_RandomAccessIter __rotate_aux ( _RandomAccessIter  __first,
_RandomAccessIter  __middle,
_RandomAccessIter  __last,
_Distance *  ,
_Tp *   
)

Definition at line 443 of file _algo.c.

446  {
447 
448  _Distance __n = __last - __first;
449  _Distance __k = __middle - __first;
450  _Distance __l = __n - __k;
451  _RandomAccessIter __result = __first + (__last - __middle);
452 
453  if (__k == 0) /* __first == middle */
454  return __last;
455 
456  if (__k == __l) {
457  _STLP_STD::swap_ranges(__first, __middle, __middle);
458  return __result;
459  }
460 
461  _Distance __d = _STLP_PRIV __gcd(__n, __k);
462 
463  for (_Distance __i = 0; __i < __d; __i++) {
464  _Tp __tmp = *__first;
465  _RandomAccessIter __p = __first;
466 
467  if (__k < __l) {
468  for (_Distance __j = 0; __j < __l/__d; __j++) {
469  if (__p > __first + __l) {
470  *__p = *(__p - __l);
471  __p -= __l;
472  }
473 
474  *__p = *(__p + __k);
475  __p += __k;
476  }
477  }
478 
479  else {
480  for (_Distance __j = 0; __j < __k/__d - 1; __j ++) {
481  if (__p < __last - __k) {
482  *__p = *(__p + __k);
483  __p += __k;
484  }
485 
486  *__p = * (__p - __l);
487  __p -= __l;
488  }
489  }
490 
491  *__p = __tmp;
492  ++__first;
493  }
494 
495  return __result;
496 }
return __n
Definition: _algo.h:75
_STLP_INLINE_LOOP _ForwardIter2 swap_ranges(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2)
Definition: _algo.h:160
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_INLINE_LOOP _EuclideanRingElement __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
Definition: _algo.c:432
#define _STLP_PRIV
Definition: _dm.h:70

◆ __rotate_aux() [4/4]

template<class _RandomAccessIter , class _Distance >
_RandomAccessIter __rotate_aux ( _RandomAccessIter  __first,
_RandomAccessIter  __middle,
_RandomAccessIter  __last,
_Distance *  __dis,
const random_access_iterator_tag  
)
inline

Definition at line 500 of file _algo.c.

501  {
502  return _STLP_PRIV __rotate_aux(__first, __middle, __last,
503  __dis, _STLP_VALUE_TYPE(__first, _RandomAccessIter));
504 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __rotate_aux(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last, _Distance *, const forward_iterator_tag &)
Definition: _algo.c:370
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70

◆ __search_n() [1/2]

template<class _RandomAccessIter , class _Integer , class _Tp , class _BinaryPred , class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __search_n ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Integer  __count,
const _Tp &  __val,
_BinaryPred  __pred,
_Distance *  ,
const random_access_iterator_tag  
)

Definition at line 154 of file _algo.c.

157 {
158  _Distance __tailSize = __last - __first;
159  const _Distance __pattSize = __count;
160  const _Distance __skipOffset = __pattSize - 1;
161  _RandomAccessIter __backTrack;
162  _Distance __remainder, __prevRemainder;
163 
164  for ( _RandomAccessIter __lookAhead = __first + __skipOffset; __tailSize >= __pattSize; __lookAhead += __pattSize ) { // the main loop...
165  //__lookAhead here is always pointing to the last element of next possible match.
166  __tailSize -= __pattSize;
167 
168  while ( !__pred(*__lookAhead, __val) ) { // the skip loop...
169  if (__tailSize < __pattSize)
170  return __last;
171 
172  __lookAhead += __pattSize;
173  __tailSize -= __pattSize;
174  }
175 
176  if ( __skipOffset == 0 ) {
177  return (__lookAhead - __skipOffset); //Success
178  }
179 
180  __remainder = __skipOffset;
181 
182  for (__backTrack = __lookAhead; __pred(*--__backTrack, __val); ) {
183  if (--__remainder == 0)
184  return (__lookAhead - __skipOffset); //Success
185  }
186 
187  if (__remainder > __tailSize)
188  return __last; //failure
189 
190  __lookAhead += __remainder;
191  __tailSize -= __remainder;
192 
193  while ( __pred(*__lookAhead, __val) ) {
194  __prevRemainder = __remainder;
195  __backTrack = __lookAhead;
196 
197  do {
198  if (--__remainder == 0)
199  return (__lookAhead - __skipOffset); //Success
200  } while (__pred(*--__backTrack, __val));
201 
202  //adjust remainder for next comparison
203  __remainder += __pattSize - __prevRemainder;
204 
205  if (__remainder > __tailSize)
206  return __last; //failure
207 
208  __lookAhead += __remainder;
209  __tailSize -= __remainder;
210  }
211 
212  //__lookAhead here is always pointing to the element of the last mismatch.
213  }
214 
215  return __last; //failure
216 }
_STLP_INLINE_LOOP _InputIter _Predicate __pred
Definition: _algo.h:68
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656

Referenced by search_n().

◆ __search_n() [2/2]

template<class _ForwardIter , class _Integer , class _Tp , class _Distance , class _BinaryPred >
_ForwardIter __search_n ( _ForwardIter  __first,
_ForwardIter  __last,
_Integer  __count,
const _Tp &  __val,
_BinaryPred  __pred,
_Distance *  ,
const forward_iterator_tag  
)

Definition at line 220 of file _algo.c.

222  {
223  for (; (__first != __last) && !__pred(*__first, __val); ++__first) {}
224  while (__first != __last) {
225  _Integer __n = __count - 1;
226  _ForwardIter __i = __first;
227  ++__i;
228  while (__i != __last && __n != 0 && __pred(*__i, __val)) {
229  ++__i;
230  --__n;
231  }
232  if (__n == 0)
233  return __first;
234  else if (__i != __last)
235  for (__first = ++__i; (__first != __last) && !__pred(*__first, __val); ++__first) {}
236  else
237  break;
238  }
239  return __last;
240 }
return __n
Definition: _algo.h:75
_STLP_INLINE_LOOP _InputIter _Predicate __pred
Definition: _algo.h:68
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656

◆ __set_difference()

template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_difference ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result,
_Compare  __comp 
)

Definition at line 1708 of file _algo.c.

1710  {
1711  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
1712  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
1713  while (__first1 != __last1 && __first2 != __last2)
1714  if (__comp(*__first1, *__first2)) {
1715  _STLP_VERBOSE_ASSERT(!__comp(*__first2, *__first1), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1716  *__result = *__first1;
1717  ++__first1;
1718  ++__result;
1719  }
1720  else if (__comp(*__first2, *__first1))
1721  ++__first2;
1722  else {
1723  ++__first1;
1724  ++__first2;
1725  }
1726  return _STLP_STD::copy(__first1, __last1, __result);
1727 }
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by set_difference().

◆ __set_intersection()

template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_intersection ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result,
_Compare  __comp 
)

Definition at line 1665 of file _algo.c.

1667  {
1668  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
1669  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
1670  while (__first1 != __last1 && __first2 != __last2)
1671  if (__comp(*__first1, *__first2)) {
1672  _STLP_VERBOSE_ASSERT(!__comp(*__first2, *__first1), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1673  ++__first1;
1674  }
1675  else if (__comp(*__first2, *__first1))
1676  ++__first2;
1677  else {
1678  *__result = *__first1;
1679  ++__first1;
1680  ++__first2;
1681  ++__result;
1682  }
1683  return __result;
1684 }
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by set_intersection().

◆ __set_symmetric_difference()

template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_symmetric_difference ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result,
_Compare  __comp 
)

Definition at line 1751 of file _algo.c.

1753  {
1754  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
1755  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
1756  while (__first1 != __last1 && __first2 != __last2) {
1757  if (__comp(*__first1, *__first2)) {
1758  _STLP_VERBOSE_ASSERT(!__comp(*__first2, *__first1), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1759  *__result = *__first1;
1760  ++__first1;
1761  ++__result;
1762  }
1763  else if (__comp(*__first2, *__first1)) {
1764  *__result = *__first2;
1765  ++__first2;
1766  ++__result;
1767  }
1768  else {
1769  ++__first1;
1770  ++__first2;
1771  }
1772  }
1773  return _STLP_STD::copy(__first2, __last2, _STLP_STD::copy(__first1, __last1, __result));
1774 }
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by set_symmetric_difference().

◆ __set_union()

template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_union ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result,
_Compare  __comp 
)

Definition at line 1617 of file _algo.c.

1619  {
1620  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
1621  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
1622  while (__first1 != __last1 && __first2 != __last2) {
1623  if (__comp(*__first1, *__first2)) {
1624  _STLP_VERBOSE_ASSERT(!__comp(*__first2, *__first1), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1625  *__result = *__first1;
1626  ++__first1;
1627  }
1628  else if (__comp(*__first2, *__first1)) {
1629  _STLP_VERBOSE_ASSERT(!__comp(*__first1, *__first2), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1630  *__result = *__first2;
1631  ++__first2;
1632  }
1633  else {
1634  *__result = *__first1;
1635  ++__first1;
1636  ++__first2;
1637  }
1638  ++__result;
1639  }
1640  return _STLP_STD::copy(__first2, __last2, _STLP_STD::copy(__first1, __last1, __result));
1641 }
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by set_union().

◆ __stable_partition_adaptive()

template<class _ForwardIter , class _Pointer , class _Predicate , class _Distance >
_ForwardIter __stable_partition_adaptive ( _ForwardIter  __first,
_ForwardIter  __last,
_Predicate  __pred,
_Distance  __len,
_Pointer  __buffer,
_Distance  __buffer_size,
bool  __pred_of_first,
bool  __pred_of_before_last 
)

Definition at line 768 of file _algo.c.

772  {
773  if (__len <= __buffer_size) {
774  _ForwardIter __result1 = __first;
775  _Pointer __result2 = __buffer;
776  if ((__first != __last) && (!__pred_of_first || __pred(*__first))) {
777  *__result2 = *__first;
778  ++__result2; ++__first; --__len;
779  }
780  for (; __first != __last ; ++__first, --__len) {
781  if (((__len == 1) && (__pred_of_before_last || __pred(*__first))) ||
782  ((__len != 1) && __pred(*__first))){
783  *__result1 = *__first;
784  ++__result1;
785  }
786  else {
787  *__result2 = *__first;
788  ++__result2;
789  }
790  }
791  _STLP_STD::copy(__buffer, __result2, __result1);
792  return __result1;
793  }
794  else {
795  _ForwardIter __middle = __first;
796  _Distance __half_len = __len / 2;
797  _STLP_STD::advance(__middle, __half_len);
799  __half_len, __buffer, __buffer_size,
800  __pred_of_first, false),
801  __middle,
803  __len - __half_len, __buffer, __buffer_size,
804  true, __pred_of_before_last));
805  }
806 }
_STLP_INLINE_LOOP _InputIter _Predicate __pred
Definition: _algo.h:68
_ForwardIter __rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
Definition: _algo.c:508
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_ForwardIter __stable_partition_adaptive(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Distance __len, _Pointer __buffer, _Distance __buffer_size, bool __pred_of_first, bool __pred_of_before_last)
Definition: _algo.c:768
#define _STLP_PRIV
Definition: _dm.h:70
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51

Referenced by __stable_partition_aux_aux().

◆ __stable_partition_aux() [1/2]

template<class _ForwardIter , class _Predicate >
_ForwardIter __stable_partition_aux ( _ForwardIter  __first,
_ForwardIter  __last,
_Predicate  __pred,
const forward_iterator_tag  
)

Definition at line 827 of file _algo.c.

828  {
829  return __stable_partition_aux_aux(__first, __last, __pred,
830  _STLP_VALUE_TYPE(__first, _ForwardIter),
831  _STLP_DISTANCE_TYPE(__first, _ForwardIter), false);
832 }
_STLP_INLINE_LOOP _InputIter _Predicate __pred
Definition: _algo.h:68
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
_ForwardIter __stable_partition_aux_aux(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Tp *, _Distance *, bool __pred_of_before_last)
Definition: _algo.c:810
#define _STLP_DISTANCE_TYPE(_It, _Tp)

Referenced by stable_partition().

◆ __stable_partition_aux() [2/2]

template<class _BidirectIter , class _Predicate >
_BidirectIter __stable_partition_aux ( _BidirectIter  __first,
_BidirectIter  __last,
_Predicate  __pred,
const bidirectional_iterator_tag  
)

Definition at line 836 of file _algo.c.

837  {
838  for (--__last;;) {
839  if (__first == __last)
840  return __first;
841  else if (!__pred(*__last))
842  --__last;
843  else
844  break;
845  }
846  ++__last;
847  //Here we know that __pred(*--__last) is true
848  return __stable_partition_aux_aux(__first, __last, __pred,
849  _STLP_VALUE_TYPE(__first, _BidirectIter),
850  _STLP_DISTANCE_TYPE(__first, _BidirectIter), true);
851 }
_STLP_INLINE_LOOP _InputIter _Predicate __pred
Definition: _algo.h:68
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
_ForwardIter __stable_partition_aux_aux(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Tp *, _Distance *, bool __pred_of_before_last)
Definition: _algo.c:810
#define _STLP_DISTANCE_TYPE(_It, _Tp)

◆ __stable_partition_aux_aux()

template<class _ForwardIter , class _Predicate , class _Tp , class _Distance >
_ForwardIter __stable_partition_aux_aux ( _ForwardIter  __first,
_ForwardIter  __last,
_Predicate  __pred,
_Tp *  ,
_Distance *  ,
bool  __pred_of_before_last 
)
inline

Definition at line 810 of file _algo.c.

811  {
813  _STLP_MPWFIX_TRY //*TY 06/01/2000 - they forget to call dtor for _Temporary_buffer if no try/catch block is present
814  return (__buf.size() > 0) ?
816  _Distance(__buf.requested_size()),
817  __buf.begin(), __buf.size(),
818  false, __pred_of_before_last) :
820  _Distance(__buf.requested_size()),
821  false, __pred_of_before_last);
822  _STLP_MPWFIX_CATCH //*TY 06/01/2000 - they forget to call dtor for _Temporary_buffer if no try/catch block is present
823 }
_STLP_INLINE_LOOP _InputIter _Predicate __pred
Definition: _algo.h:68
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __inplace_stable_partition(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Distance __len, bool __pred_of_first, bool __pred_of_before_last)
Definition: _algo.c:752
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_MPWFIX_TRY
Definition: _apple.h:110
_ForwardIter __stable_partition_adaptive(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Distance __len, _Pointer __buffer, _Distance __buffer_size, bool __pred_of_first, bool __pred_of_before_last)
Definition: _algo.c:768
#define _STLP_MPWFIX_CATCH
Definition: _apple.h:111

Referenced by __stable_partition_aux().

◆ __stable_sort_adaptive()

template<class _RandomAccessIter , class _Pointer , class _Distance , class _Compare >
void __stable_sort_adaptive ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Pointer  __buffer,
_Distance  __buffer_size,
_Compare  __comp 
)

Definition at line 1159 of file _algo.c.

1161  {
1162  _Distance __len = (__last - __first + 1) / 2;
1163  _RandomAccessIter __middle = __first + __len;
1164  if (__len > __buffer_size) {
1165  __stable_sort_adaptive(__first, __middle, __buffer, __buffer_size,
1166  __comp);
1167  __stable_sort_adaptive(__middle, __last, __buffer, __buffer_size,
1168  __comp);
1169  }
1170  else {
1171  __merge_sort_with_buffer(__first, __middle, __buffer, (_Distance*)0,
1172  __comp);
1173  __merge_sort_with_buffer(__middle, __last, __buffer, (_Distance*)0,
1174  __comp);
1175  }
1176  __merge_adaptive(__first, __middle, __last, _Distance(__middle - __first),
1177  _Distance(__last - __middle), __buffer, __buffer_size,
1178  __comp);
1179 }
void __merge_sort_with_buffer(_RandomAccessIter __first, _RandomAccessIter __last, _Pointer __buffer, _Distance *, _Compare __comp)
Definition: _algo.c:1074
void __stable_sort_adaptive(_RandomAccessIter __first, _RandomAccessIter __last, _Pointer __buffer, _Distance __buffer_size, _Compare __comp)
Definition: _algo.c:1159
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
void __merge_adaptive(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Pointer __buffer, _Distance __buffer_size, _Compare __comp)
Definition: _algo.c:1115

Referenced by __stable_sort_aux().

◆ __stable_sort_aux()

template<class _RandomAccessIter , class _Tp , class _Distance , class _Compare >
void __stable_sort_aux ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Tp *  ,
_Distance *  ,
_Compare  __comp 
)

Definition at line 1182 of file _algo.c.

1184  {
1186  if (buf.begin() == 0)
1187  __inplace_stable_sort(__first, __last, __comp);
1188  else
1189  __stable_sort_adaptive(__first, __last, buf.begin(),
1190  _Distance(buf.size()),
1191  __comp);
1192 }
_STLP_MOVE_TO_PRIV_NAMESPACE void __inplace_stable_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
Definition: _algo.c:1020
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void __stable_sort_adaptive(_RandomAccessIter __first, _RandomAccessIter __last, _Pointer __buffer, _Distance __buffer_size, _Compare __comp)
Definition: _algo.c:1159
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68

Referenced by stable_sort().

◆ __unguarded_insertion_sort()

template<class _RandomAccessIter , class _Compare >
void __unguarded_insertion_sort ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Compare  __comp 
)
inline

Definition at line 952 of file _algo.c.

954  {
955  __unguarded_insertion_sort_aux(__first, __last, _STLP_VALUE_TYPE(__first, _RandomAccessIter), __comp);
956 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
void __unguarded_insertion_sort_aux(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Compare __comp)
Definition: _algo.c:944

Referenced by __final_insertion_sort().

◆ __unguarded_insertion_sort_aux()

template<class _RandomAccessIter , class _Tp , class _Compare >
void __unguarded_insertion_sort_aux ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Tp *  ,
_Compare  __comp 
)

Definition at line 944 of file _algo.c.

946  {
947  for (_RandomAccessIter __i = __first; __i != __last; ++__i)
948  __unguarded_linear_insert<_RandomAccessIter, _Tp, _Compare>(__i, *__i, __comp);
949 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68

Referenced by __unguarded_insertion_sort().

◆ __unguarded_linear_insert()

template<class _RandomAccessIter , class _Tp , class _Compare >
void __unguarded_linear_insert ( _RandomAccessIter  __last,
_Tp  __val,
_Compare  __comp 
)

Definition at line 907 of file _algo.c.

908  {
909  _RandomAccessIter __next = __last;
910  --__next;
911  while (__comp(__val, *__next)) {
912  _STLP_VERBOSE_ASSERT(!__comp(*__next, __val), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
913  *__last = *__next;
914  __last = __next;
915  --__next;
916  }
917  *__last = __val;
918 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by __linear_insert().

◆ __unguarded_partition()

template<class _RandomAccessIter , class _Tp , class _Compare >
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __unguarded_partition ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Tp  __pivot,
_Compare  __comp 
)

Definition at line 883 of file _algo.c.

885  {
886  for (;;) {
887  while (__comp(*__first, __pivot)) {
888  _STLP_VERBOSE_ASSERT(!__comp(__pivot, *__first), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
889  ++__first;
890  }
891  --__last;
892  while (__comp(__pivot, *__last)) {
893  _STLP_VERBOSE_ASSERT(!__comp(*__last, __pivot), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
894  --__last;
895  }
896  if (!(__first < __last))
897  return __first;
898  iter_swap(__first, __last);
899  ++__first;
900  }
901 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_MOVE_TO_STD_NAMESPACE void iter_swap(_ForwardIter1 __i1, _ForwardIter2 __i2)
Definition: _algobase.h:120
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by __introsort_loop(), and __nth_element().

◆ __unique_copy() [1/3]

template<class _InputIterator , class _OutputIterator , class _BinaryPredicate , class _Tp >
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _OutputIterator __unique_copy ( _InputIterator  __first,
_InputIterator  __last,
_OutputIterator  __result,
_BinaryPredicate  __binary_pred,
_Tp *   
)

Definition at line 295 of file _algo.c.

297  {
298  _Tp __val = *__first;
299  *__result = __val;
300  while (++__first != __last)
301  if (!__binary_pred(__val, *__first)) {
302  __val = *__first;
303  *++__result = __val;
304  }
305  return ++__result;
306 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656

Referenced by __unique_copy(), and unique_copy().

◆ __unique_copy() [2/3]

template<class _InputIter , class _OutputIter , class _BinaryPredicate >
_OutputIter __unique_copy ( _InputIter  __first,
_InputIter  __last,
_OutputIter  __result,
_BinaryPredicate  __binary_pred,
const output_iterator_tag  
)
inline

Definition at line 310 of file _algo.c.

311  {
312  return _STLP_PRIV __unique_copy(__first, __last, __result, __binary_pred,
313  _STLP_VALUE_TYPE(__first, _InputIter));
314 }
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _OutputIterator __unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __binary_pred, _Tp *)
Definition: _algo.c:295
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70

◆ __unique_copy() [3/3]

template<class _InputIter , class _ForwardIter , class _BinaryPredicate >
_STLP_INLINE_LOOP _ForwardIter __unique_copy ( _InputIter  __first,
_InputIter  __last,
_ForwardIter  __result,
_BinaryPredicate  __binary_pred,
const forward_iterator_tag  
)

Definition at line 318 of file _algo.c.

319  {
320  *__result = *__first;
321  while (++__first != __last)
322  if (!__binary_pred(*__result, *__first)) *++__result = *__first;
323  return ++__result;
324 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68

◆ __upper_bound()

template<class _ForwardIter , class _Tp , class _Compare1 , class _Compare2 , class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __upper_bound ( _ForwardIter  __first,
_ForwardIter  __last,
const _Tp &  __val,
_Compare1  __comp1,
_Compare2  __comp2,
_Distance *   
)

Definition at line 1356 of file _algo.c.

1357  {
1358  _Distance __len = _STLP_STD::distance(__first, __last);
1359  _Distance __half;
1360 
1361  while (__len > 0) {
1362  __half = __len >> 1;
1363  _ForwardIter __middle = __first;
1364  _STLP_STD::advance(__middle, __half);
1365  if (__comp2(__val, *__middle)) {
1366  _STLP_VERBOSE_ASSERT(!__comp1(*__middle, __val), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1367  __len = __half;
1368  }
1369  else {
1370  __first = __middle;
1371  ++__first;
1372  __len = __len - __half - 1;
1373  }
1374  }
1375  return __first;
1376 }
GLsizei GLsizei GLfloat distance
Definition: glext.h:11755
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by __equal_range(), and upper_bound().

◆ find_end()

template<class _ForwardIter1 , class _ForwardIter2 >
_ForwardIter1 find_end ( _ForwardIter1  __first1,
_ForwardIter1  __last1,
_ForwardIter2  __first2,
_ForwardIter2  __last2 
)

Definition at line 273 of file _algo.c.

274  {
275  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
276  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
277  return _STLP_PRIV __find_end(__first1, __last1, __first2, __last2,
279  _STLP_ITERATOR_CATEGORY(__first1, _ForwardIter1),
280  _STLP_ITERATOR_CATEGORY(__first2, _ForwardIter2),
281 #else
284 #endif
285  _STLP_PRIV __equal_to(_STLP_VALUE_TYPE(__first1, _ForwardIter1))
286  );
287 }
#define _STLP_CLASS_PARTIAL_SPECIALIZATION
Definition: features.h:120
equal_to< _Tp > __equal_to(_Tp *)
_ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2, const forward_iterator_tag &, const forward_iterator_tag &, _BinaryPredicate __comp)
Definition: _algobase.c:369
#define _STLP_ITERATOR_CATEGORY(_It, _Tp)
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440

Referenced by basic_string< char, char_traits< char >, allocator< char > >::rfind().

◆ includes() [1/2]

template<class _InputIter1 , class _InputIter2 , class _Compare >
_STLP_MOVE_TO_STD_NAMESPACE bool includes ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_Compare  __comp 
)

Definition at line 1601 of file _algo.c.

1602  {
1603  return _STLP_PRIV __includes(__first1, __last1, __first2, __last2, __comp);
1604 }
_STLP_MOVE_TO_PRIV_NAMESPACE bool __includes(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _Compare __comp)
Definition: _algo.c:1581
#define _STLP_PRIV
Definition: _dm.h:70

◆ includes() [2/2]

template<class _InputIter1 , class _InputIter2 >
bool includes ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2 
)

Definition at line 1607 of file _algo.c.

1608  {
1609  return _STLP_PRIV __includes(__first1, __last1, __first2, __last2,
1610  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first1, _InputIter1)));
1611 }
_STLP_MOVE_TO_PRIV_NAMESPACE bool __includes(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _Compare __comp)
Definition: _algo.c:1581
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70

◆ inplace_merge() [1/2]

template<class _BidirectionalIter >
_STLP_MOVE_TO_STD_NAMESPACE void inplace_merge ( _BidirectionalIter  __first,
_BidirectionalIter  __middle,
_BidirectionalIter  __last 
)

Definition at line 1553 of file _algo.c.

1555  {
1556  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __middle))
1557  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__middle, __last))
1558  if (__first == __middle || __middle == __last)
1559  return;
1560  _STLP_PRIV __inplace_merge_aux(__first, __middle, __last,
1561  _STLP_VALUE_TYPE(__first, _BidirectionalIter), _STLP_DISTANCE_TYPE(__first, _BidirectionalIter),
1562  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _BidirectionalIter)));
1563 }
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
void __inplace_merge_aux(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Tp *, _Distance *, _Compare __comp)
Definition: _algo.c:1534
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define _STLP_DISTANCE_TYPE(_It, _Tp)

Referenced by InplaceTest::inplmrg1(), InplaceTest::inplmrg2(), test_inplace_merge_1::operator()(), and test_inplace_merge_2::operator()().

◆ inplace_merge() [2/2]

template<class _BidirectionalIter , class _Compare >
void inplace_merge ( _BidirectionalIter  __first,
_BidirectionalIter  __middle,
_BidirectionalIter  __last,
_Compare  __comp 
)

Definition at line 1566 of file _algo.c.

1568  {
1569  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __middle))
1570  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__middle, __last))
1571  if (__first == __middle || __middle == __last)
1572  return;
1573  _STLP_PRIV __inplace_merge_aux(__first, __middle, __last,
1574  _STLP_VALUE_TYPE(__first, _BidirectionalIter), _STLP_DISTANCE_TYPE(__first, _BidirectionalIter),
1575  __comp);
1576 }
void __inplace_merge_aux(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Tp *, _Distance *, _Compare __comp)
Definition: _algo.c:1534
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define _STLP_DISTANCE_TYPE(_It, _Tp)

◆ is_heap() [1/2]

template<class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE bool is_heap ( _RandomAccessIter  __first,
_RandomAccessIter  __last 
)

Definition at line 1985 of file _algo.c.

1985  {
1986  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1987  return _STLP_PRIV __is_heap(__first, _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _RandomAccessIter)), __last - __first);
1988 }
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_PRIV_NAMESPACE bool __is_heap(_RandomAccessIter __first, _StrictWeakOrdering __comp, _Distance __n)
Definition: _algo.c:1968

◆ is_heap() [2/2]

template<class _RandomAccessIter , class _StrictWeakOrdering >
bool is_heap ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_StrictWeakOrdering  __comp 
)

Definition at line 1991 of file _algo.c.

1992  {
1993  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1994  return _STLP_PRIV __is_heap(__first, __comp, __last - __first);
1995 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_PRIV_NAMESPACE bool __is_heap(_RandomAccessIter __first, _StrictWeakOrdering __comp, _Distance __n)
Definition: _algo.c:1968

◆ max_element() [1/2]

template<class _ForwardIter >
_ForwardIter max_element ( _ForwardIter  __first,
_ForwardIter  __last 
)

Definition at line 1800 of file _algo.c.

1800  {
1801  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1802  if (__first == __last) return __first;
1803  _ForwardIter __result = __first;
1804  while (++__first != __last)
1805  if (*__result < *__first) {
1806  _STLP_VERBOSE_ASSERT(!(*__first < *__result), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1807  __result = __first;
1808  }
1809  return __result;
1810 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by valarray< bool >::max(), MaxTest::maxelem1(), and MaxTest::maxelem2().

◆ max_element() [2/2]

template<class _ForwardIter , class _Compare >
_ForwardIter max_element ( _ForwardIter  __first,
_ForwardIter  __last,
_Compare  __comp 
)

Definition at line 1813 of file _algo.c.

1814  {
1815  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1816  if (__first == __last) return __first;
1817  _ForwardIter __result = __first;
1818  while (++__first != __last) {
1819  if (__comp(*__result, *__first)) {
1820  _STLP_VERBOSE_ASSERT(!__comp(*__first, *__result), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1821  __result = __first;
1822  }
1823  }
1824  return __result;
1825 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

◆ merge() [1/2]

template<class _InputIter1 , class _InputIter2 , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter merge ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result 
)

Definition at line 1419 of file _algo.c.

1421  {
1422  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
1423  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
1424  while (__first1 != __last1 && __first2 != __last2) {
1425  if (*__first2 < *__first1) {
1426  *__result = *__first2;
1427  ++__first2;
1428  }
1429  else {
1430  *__result = *__first1;
1431  ++__first1;
1432  }
1433  ++__result;
1434  }
1435  return _STLP_STD::copy(__first2, __last2, _STLP_STD::copy(__first1, __last1, __result));
1436 }
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51

Referenced by __merge_adaptive(), __merge_sort_loop(), create_diff_row_query(), ext4_ext_insert_extent(), gather_merge_data(), MergeTest::merge0(), MergeTest::merge1(), MergeTest::merge2(), MergeChmProperties(), MsiDatabaseMergeW(), nsChannel_SetResponseHeader(), parse_obj_node_param(), and test_IImageList_Merge().

◆ merge() [2/2]

template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_OutputIter merge ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result,
_Compare  __comp 
)

Definition at line 1440 of file _algo.c.

1442  {
1443  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
1444  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
1445  while (__first1 != __last1 && __first2 != __last2) {
1446  if (__comp(*__first2, *__first1)) {
1447  _STLP_VERBOSE_ASSERT(!__comp(*__first1, *__first2), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1448  *__result = *__first2;
1449  ++__first2;
1450  }
1451  else {
1452  *__result = *__first1;
1453  ++__first1;
1454  }
1455  ++__result;
1456  }
1457  return _STLP_STD::copy(__first2, __last2, _STLP_STD::copy(__first1, __last1, __result));
1458 }
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

◆ min_element() [1/2]

template<class _ForwardIter >
_ForwardIter min_element ( _ForwardIter  __first,
_ForwardIter  __last 
)

Definition at line 1828 of file _algo.c.

1828  {
1829  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1830  if (__first == __last) return __first;
1831  _ForwardIter __result = __first;
1832  while (++__first != __last)
1833  if (*__first < *__result) {
1834  _STLP_VERBOSE_ASSERT(!(*__result < *__first), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1835  __result = __first;
1836  }
1837  return __result;
1838 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by valarray< bool >::min(), MinTest::minelem1(), and MinTest::minelem2().

◆ min_element() [2/2]

template<class _ForwardIter , class _Compare >
_ForwardIter min_element ( _ForwardIter  __first,
_ForwardIter  __last,
_Compare  __comp 
)

Definition at line 1841 of file _algo.c.

1842  {
1843  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1844  if (__first == __last) return __first;
1845  _ForwardIter __result = __first;
1846  while (++__first != __last) {
1847  if (__comp(*__first, *__result)) {
1848  _STLP_VERBOSE_ASSERT(!__comp(*__result, *__first), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1849  __result = __first;
1850  }
1851  }
1852  return __result;
1853 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

◆ next_permutation() [1/2]

template<class _BidirectionalIter >
_STLP_MOVE_TO_STD_NAMESPACE bool next_permutation ( _BidirectionalIter  __first,
_BidirectionalIter  __last 
)

Definition at line 1896 of file _algo.c.

1896  {
1897  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1898  return _STLP_PRIV __next_permutation(__first, __last,
1899  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _BidirectionalIter)));
1900 }
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_PRIV_NAMESPACE bool __next_permutation(_BidirectionalIter __first, _BidirectionalIter __last, _Compare __comp)
Definition: _algo.c:1860

Referenced by PermTest::nextprm0(), PermTest::nextprm1(), and PermTest::nextprm2().

◆ next_permutation() [2/2]

template<class _BidirectionalIter , class _Compare >
bool next_permutation ( _BidirectionalIter  __first,
_BidirectionalIter  __last,
_Compare  __comp 
)

Definition at line 1903 of file _algo.c.

1904  {
1905  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1906  return _STLP_PRIV __next_permutation(__first, __last, __comp);
1907 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_PRIV_NAMESPACE bool __next_permutation(_BidirectionalIter __first, _BidirectionalIter __last, _Compare __comp)
Definition: _algo.c:1860

◆ nth_element() [1/2]

template<class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE void nth_element ( _RandomAccessIter  __first,
_RandomAccessIter  __nth,
_RandomAccessIter  __last 
)

Definition at line 1335 of file _algo.c.

1336  {
1337  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __nth))
1338  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__nth, __last))
1339  _STLP_PRIV __nth_element(__first, __nth, __last, _STLP_VALUE_TYPE(__first, _RandomAccessIter),
1340  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _RandomAccessIter)));
1341 }
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_PRIV_NAMESPACE void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth, _RandomAccessIter __last, _Tp *, _Compare __comp)
Definition: _algo.c:1314

Referenced by NthElemTest::nthelem0(), NthElemTest::nthelem1(), and NthElemTest::nthelem2().

◆ nth_element() [2/2]

template<class _RandomAccessIter , class _Compare >
void nth_element ( _RandomAccessIter  __first,
_RandomAccessIter  __nth,
_RandomAccessIter  __last,
_Compare  __comp 
)

Definition at line 1344 of file _algo.c.

1345  {
1346  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __nth))
1347  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__nth, __last))
1348  _STLP_PRIV __nth_element(__first, __nth, __last, _STLP_VALUE_TYPE(__first, _RandomAccessIter), __comp);
1349 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_PRIV_NAMESPACE void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth, _RandomAccessIter __last, _Tp *, _Compare __comp)
Definition: _algo.c:1314

◆ partial_sort() [1/2]

template<class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE void partial_sort ( _RandomAccessIter  __first,
_RandomAccessIter  __middle,
_RandomAccessIter  __last 
)

Definition at line 1236 of file _algo.c.

1237  {
1238  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __middle))
1239  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__middle, __last))
1240  _STLP_PRIV __partial_sort(__first, __middle, __last, _STLP_VALUE_TYPE(__first, _RandomAccessIter),
1241  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _RandomAccessIter)));
1242 }
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
_STLP_MOVE_TO_PRIV_NAMESPACE void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last, _Tp *, _Compare __comp)
Definition: _algo.c:1220
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440

Referenced by __introsort_loop(), PartialTest::parsrt0(), PartialTest::parsrt1(), and PartialTest::parsrt2().

◆ partial_sort() [2/2]

template<class _RandomAccessIter , class _Compare >
void partial_sort ( _RandomAccessIter  __first,
_RandomAccessIter  __middle,
_RandomAccessIter  __last,
_Compare  __comp 
)

Definition at line 1245 of file _algo.c.

1246  {
1247  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __middle))
1248  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__middle, __last))
1249  _STLP_PRIV __partial_sort(__first, __middle, __last, _STLP_VALUE_TYPE(__first, _RandomAccessIter), __comp);
1250 }
_STLP_MOVE_TO_PRIV_NAMESPACE void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last, _Tp *, _Compare __comp)
Definition: _algo.c:1220
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440

◆ partial_sort_copy() [1/2]

template<class _InputIter , class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE _RandomAccessIter partial_sort_copy ( _InputIter  __first,
_InputIter  __last,
_RandomAccessIter  __result_first,
_RandomAccessIter  __result_last 
)

Definition at line 1287 of file _algo.c.

1288  {
1289  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1290  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__result_first, __result_last))
1291  return _STLP_PRIV __partial_sort_copy(__first, __last, __result_first, __result_last,
1292  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _InputIter)),
1293  _STLP_DISTANCE_TYPE(__result_first, _RandomAccessIter),
1294  _STLP_VALUE_TYPE(__first, _InputIter));
1295 }
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __partial_sort_copy(_InputIter __first, _InputIter __last, _RandomAccessIter __result_first, _RandomAccessIter __result_last, _Compare __comp, _Distance *, _Tp *)
Definition: _algo.c:1256
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define _STLP_DISTANCE_TYPE(_It, _Tp)

Referenced by PartialTest::parsrtc0(), PartialTest::parsrtc1(), and PartialTest::parsrtc2().

◆ partial_sort_copy() [2/2]

template<class _InputIter , class _RandomAccessIter , class _Compare >
_RandomAccessIter partial_sort_copy ( _InputIter  __first,
_InputIter  __last,
_RandomAccessIter  __result_first,
_RandomAccessIter  __result_last,
_Compare  __comp 
)

Definition at line 1299 of file _algo.c.

1301  {
1302  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1303  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__result_first, __result_last))
1304  return _STLP_PRIV __partial_sort_copy(__first, __last, __result_first, __result_last,
1305  __comp,
1306  _STLP_DISTANCE_TYPE(__result_first, _RandomAccessIter),
1307  _STLP_VALUE_TYPE(__first, _InputIter));
1308 }
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __partial_sort_copy(_InputIter __first, _InputIter __last, _RandomAccessIter __result_first, _RandomAccessIter __result_last, _Compare __comp, _Distance *, _Tp *)
Definition: _algo.c:1256
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define _STLP_DISTANCE_TYPE(_It, _Tp)

◆ partition()

template<class _ForwardIter , class _Predicate >
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter partition ( _ForwardIter  __first,
_ForwardIter  __last,
_Predicate  __pred 
)

Definition at line 738 of file _algo.c.

738  {
739  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
740  return _STLP_PRIV __partition(__first, __last, __pred, _STLP_ITERATOR_CATEGORY(__first, _ForwardIter));
741 }
_STLP_INLINE_LOOP _InputIter _Predicate __pred
Definition: _algo.h:68
#define _STLP_ITERATOR_CATEGORY(_It, _Tp)
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _ForwardIter __partition(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, const forward_iterator_tag &)
Definition: _algo.c:676

Referenced by DiskIoctlSetDriveLayout(), PartitionTest::ptition0(), PartitionTest::ptition1(), and UpdateDeviceObjects().

◆ prev_permutation() [1/2]

template<class _BidirectionalIter >
_STLP_MOVE_TO_STD_NAMESPACE bool prev_permutation ( _BidirectionalIter  __first,
_BidirectionalIter  __last 
)

Definition at line 1947 of file _algo.c.

1947  {
1948  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1949  return _STLP_PRIV __prev_permutation(__first, __last,
1950  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _BidirectionalIter)));
1951 }
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_PRIV_NAMESPACE bool __prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last, _Compare __comp)
Definition: _algo.c:1912

Referenced by PermTest::prevprm0(), PermTest::prevprm1(), and PermTest::prevprm2().

◆ prev_permutation() [2/2]

template<class _BidirectionalIter , class _Compare >
bool prev_permutation ( _BidirectionalIter  __first,
_BidirectionalIter  __last,
_Compare  __comp 
)

Definition at line 1954 of file _algo.c.

1955  {
1956  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1957  return _STLP_PRIV __prev_permutation(__first, __last, __comp);
1958 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_PRIV_NAMESPACE bool __prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last, _Compare __comp)
Definition: _algo.c:1912

◆ random_sample() [1/2]

template<class _InputIter , class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE _RandomAccessIter random_sample ( _InputIter  __first,
_InputIter  __last,
_RandomAccessIter  __out_first,
_RandomAccessIter  __out_last 
)

Definition at line 650 of file _algo.c.

651  {
652  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
653  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__out_first, __out_last))
654  return _STLP_PRIV __random_sample(__first, __last,
655  __out_first, __out_last - __out_first);
656 }
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __random_sample(_InputIter __first, _InputIter __last, _RandomAccessIter __out_ite, const _Distance __n)
Definition: _algo.c:605
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440

◆ random_sample() [2/2]

template<class _InputIter , class _RandomAccessIter , class _RandomNumberGenerator >
_RandomAccessIter random_sample ( _InputIter  __first,
_InputIter  __last,
_RandomAccessIter  __out_first,
_RandomAccessIter  __out_last,
_RandomNumberGenerator &  __rand 
)

Definition at line 660 of file _algo.c.

662  {
663  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
664  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__out_first, __out_last))
665  return _STLP_PRIV __random_sample(__first, __last,
666  __out_first, __rand,
667  __out_last - __out_first);
668 }
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __random_sample(_InputIter __first, _InputIter __last, _RandomAccessIter __out_ite, const _Distance __n)
Definition: _algo.c:605
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440

◆ random_sample_n() [1/2]

template<class _ForwardIter , class _OutputIter , class _Distance >
_OutputIter random_sample_n ( _ForwardIter  __first,
_ForwardIter  __last,
_OutputIter  __out_ite,
const _Distance  __n 
)

Definition at line 560 of file _algo.c.

561  {
562  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
563  _Distance __remaining = _STLP_STD::distance(__first, __last);
564  _Distance __m = (min) (__n, __remaining);
565 
566  while (__m > 0) {
567  if (_STLP_PRIV __random_number(__remaining) < __m) {
568  *__out_ite = *__first;
569  ++__out_ite;
570  --__m;
571  }
572 
573  --__remaining;
574  ++__first;
575  }
576  return __out_ite;
577 }
return __n
Definition: _algo.h:75
GLsizei GLsizei GLfloat distance
Definition: glext.h:11755
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define min(a, b)
Definition: monoChain.cc:55
_STLP_MOVE_TO_PRIV_NAMESPACE _Distance __random_number(_Distance __n)
Definition: _algo.c:529

◆ random_sample_n() [2/2]

template<class _ForwardIter , class _OutputIter , class _Distance , class _RandomNumberGenerator >
_OutputIter random_sample_n ( _ForwardIter  __first,
_ForwardIter  __last,
_OutputIter  __out_ite,
const _Distance  __n,
_RandomNumberGenerator &  __rand 
)

Definition at line 582 of file _algo.c.

584  {
585  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
586  _Distance __remaining = _STLP_STD::distance(__first, __last);
587  _Distance __m = (min) (__n, __remaining);
588 
589  while (__m > 0) {
590  if (__rand(__remaining) < __m) {
591  *__out_ite = *__first;
592  ++__out_ite;
593  --__m;
594  }
595 
596  --__remaining;
597  ++__first;
598  }
599  return __out_ite;
600 }
return __n
Definition: _algo.h:75
GLsizei GLsizei GLfloat distance
Definition: glext.h:11755
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define min(a, b)
Definition: monoChain.cc:55

◆ random_shuffle() [1/2]

template<class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE void random_shuffle ( _RandomAccessIter  __first,
_RandomAccessIter  __last 
)

Definition at line 540 of file _algo.c.

541  {
542  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
543  if (__first == __last) return;
544  for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
545  iter_swap(__i, __first + _STLP_PRIV __random_number((__i - __first) + 1));
546 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_STD_NAMESPACE void iter_swap(_ForwardIter1 __i1, _ForwardIter2 __i2)
Definition: _algobase.h:120
_STLP_MOVE_TO_PRIV_NAMESPACE _Distance __random_number(_Distance __n)
Definition: _algo.c:529

Referenced by RndShuffleTest::rndshuf0(), and RndShuffleTest::rndshuf2().

◆ random_shuffle() [2/2]

template<class _RandomAccessIter , class _RandomNumberGenerator >
void random_shuffle ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_RandomNumberGenerator &  __rand 
)

Definition at line 549 of file _algo.c.

550  {
551  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
552  if (__first == __last) return;
553  for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
554  iter_swap(__i, __first + __rand((__i - __first) + 1));
555 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_STD_NAMESPACE void iter_swap(_ForwardIter1 __i1, _ForwardIter2 __i2)
Definition: _algobase.h:120

◆ rotate()

template<class _ForwardIter >
_STLP_MOVE_TO_STD_NAMESPACE void rotate ( _ForwardIter  __first,
_ForwardIter  __middle,
_ForwardIter  __last 
)

Definition at line 519 of file _algo.c.

519  {
520  _STLP_PRIV __rotate(__first, __middle, __last);
521 }
_ForwardIter __rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
Definition: _algo.c:508
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70

Referenced by ft_stroke_border_arcto(), ft_stroker_arcto(), ft_stroker_cap(), FT_Stroker_ConicTo(), FT_Stroker_CubicTo(), ft_stroker_inside(), ft_stroker_outside(), GdipRotateMatrix(), RotateTest::rotate0(), RotateTest::rotate1(), and test_rotate().

◆ search()

template<class _ForwardIter1 , class _ForwardIter2 >
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter1 search ( _ForwardIter1  __first1,
_ForwardIter1  __last1,
_ForwardIter2  __first2,
_ForwardIter2  __last2 
)

Definition at line 112 of file _algo.c.

113  {
114  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
115  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
116  // Test for empty ranges
117  if (__first1 == __last1 || __first2 == __last2)
118  return __first1;
119 
120  // Test for a pattern of length 1.
121  _ForwardIter2 __p1(__first2);
122 
123  if ( ++__p1 == __last2 )
124  return find(__first1, __last1, *__first2);
125 
126  // General case.
127 
128  for ( ; ; ) { // __first1 != __last1 will be checked in find below
129  __first1 = find(__first1, __last1, *__first2);
130  if (__first1 == __last1)
131  return __last1;
132 
133  _ForwardIter2 __p = __p1;
134  _ForwardIter1 __current = __first1;
135  if (++__current == __last1)
136  return __last1;
137 
138  while (*__current == *__p) {
139  if (++__p == __last2)
140  return __first1;
141  if (++__current == __last1)
142  return __last1;
143  }
144 
145  ++__first1;
146  }
147  return __first1;
148 }
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
static TAGID TAGID find
Definition: db.cpp:153

◆ search_n() [1/2]

template<class _ForwardIter , class _Integer , class _Tp >
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter search_n ( _ForwardIter  __first,
_ForwardIter  __last,
_Integer  __count,
const _Tp &  __val 
)

Definition at line 246 of file _algo.c.

247  {
248  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
249  if (__count <= 0)
250  return __first;
251  if (__count == 1)
252  //We use find when __count == 1 to use potential find overload.
253  return find(__first, __last, __val);
254  return _STLP_PRIV __search_n(__first, __last, __count, __val, equal_to<_Tp>(),
255  _STLP_DISTANCE_TYPE(__first, _ForwardIter),
256  _STLP_ITERATOR_CATEGORY(__first, _ForwardIter));
257 }
#define _STLP_ITERATOR_CATEGORY(_It, _Tp)
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __search_n(_RandomAccessIter __first, _RandomAccessIter __last, _Integer __count, const _Tp &__val, _BinaryPred __pred, _Distance *, const random_access_iterator_tag &)
Definition: _algo.c:154
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
static TAGID TAGID find
Definition: db.cpp:153
#define _STLP_DISTANCE_TYPE(_It, _Tp)

Referenced by AlgTest::search_n_test().

◆ search_n() [2/2]

template<class _ForwardIter , class _Integer , class _Tp , class _BinaryPred >
_ForwardIter search_n ( _ForwardIter  __first,
_ForwardIter  __last,
_Integer  __count,
const _Tp &  __val,
_BinaryPred  __binary_pred 
)

Definition at line 260 of file _algo.c.

262  {
263  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
264  if (__count <= 0)
265  return __first;
266  return _STLP_PRIV __search_n(__first, __last, __count, __val, __binary_pred,
267  _STLP_DISTANCE_TYPE(__first, _ForwardIter),
268  _STLP_ITERATOR_CATEGORY(__first, _ForwardIter));
269 }
#define _STLP_ITERATOR_CATEGORY(_It, _Tp)
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __search_n(_RandomAccessIter __first, _RandomAccessIter __last, _Integer __count, const _Tp &__val, _BinaryPred __pred, _Distance *, const random_access_iterator_tag &)
Definition: _algo.c:154
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
#define _STLP_DISTANCE_TYPE(_It, _Tp)

◆ set_difference() [1/2]

template<class _InputIter1 , class _InputIter2 , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_difference ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result 
)

Definition at line 1732 of file _algo.c.

1734  {
1735  return _STLP_PRIV __set_difference(__first1, __last1, __first2, __last2, __result,
1736  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first1, _InputIter1)));
1737 }
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_difference(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
Definition: _algo.c:1708
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70

Referenced by SetDifferenceTest::setdiff0(), SetDifferenceTest::setdiff1(), and SetDifferenceTest::setdiff2().

◆ set_difference() [2/2]

template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_OutputIter set_difference ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result,
_Compare  __comp 
)

Definition at line 1741 of file _algo.c.

1743  {
1744  return _STLP_PRIV __set_difference(__first1, __last1, __first2, __last2, __result, __comp);
1745 }
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_difference(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
Definition: _algo.c:1708
#define _STLP_PRIV
Definition: _dm.h:70

◆ set_intersection() [1/2]

template<class _InputIter1 , class _InputIter2 , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_intersection ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result 
)

Definition at line 1689 of file _algo.c.

1691  {
1692  return _STLP_PRIV __set_intersection(__first1, __last1, __first2, __last2, __result,
1693  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first1, _InputIter1)));
1694 }
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_intersection(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
Definition: _algo.c:1665
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70

Referenced by SetIntersectionTest::setintr0(), SetIntersectionTest::setintr1(), and SetIntersectionTest::setintr2().

◆ set_intersection() [2/2]

template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_OutputIter set_intersection ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result,
_Compare  __comp 
)

Definition at line 1698 of file _algo.c.

1700  {
1701  return _STLP_PRIV __set_intersection(__first1, __last1, __first2, __last2, __result, __comp);
1702 }
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_intersection(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
Definition: _algo.c:1665
#define _STLP_PRIV
Definition: _dm.h:70

◆ set_symmetric_difference() [1/2]

template<class _InputIter1 , class _InputIter2 , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_symmetric_difference ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result 
)

Definition at line 1780 of file _algo.c.

1782  {
1783  return _STLP_PRIV __set_symmetric_difference(__first1, __last1, __first2, __last2, __result,
1784  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first1, _InputIter1)));
1785 }
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
#define _STLP_VALUE_TYPE(_It, _Tp)
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
Definition: _algo.c:1751
#define _STLP_PRIV
Definition: _dm.h:70

Referenced by SetDifferenceTest::setsymd0(), SetDifferenceTest::setsymd1(), and SetDifferenceTest::setsymd2().

◆ set_symmetric_difference() [2/2]

template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_OutputIter set_symmetric_difference ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result,
_Compare  __comp 
)

Definition at line 1789 of file _algo.c.

1792  {
1793  return _STLP_PRIV __set_symmetric_difference(__first1, __last1, __first2, __last2, __result, __comp);
1794 }
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
Definition: _algo.c:1751
#define _STLP_PRIV
Definition: _dm.h:70

◆ set_union() [1/2]

template<class _InputIter1 , class _InputIter2 , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_union ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result 
)

Definition at line 1646 of file _algo.c.

1648  {
1649  return _STLP_PRIV __set_union(__first1, __last1, __first2, __last2, __result,
1650  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first1, _InputIter1)));
1651 }
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_union(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
Definition: _algo.c:1617
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70

Referenced by SetUnionTest::setunon0(), SetUnionTest::setunon1(), and SetUnionTest::setunon2().

◆ set_union() [2/2]

template<class _InputIter1 , class _InputIter2 , class _OutputIter , class _Compare >
_OutputIter set_union ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2,
_OutputIter  __result,
_Compare  __comp 
)

Definition at line 1655 of file _algo.c.

1657  {
1658  return _STLP_PRIV __set_union(__first1, __last1, __first2, __last2, __result, __comp);
1659 }
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_union(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
Definition: _algo.c:1617
#define _STLP_PRIV
Definition: _dm.h:70

◆ sort() [1/2]

template<class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE void sort ( _RandomAccessIter  __first,
_RandomAccessIter  __last 
)

Definition at line 993 of file _algo.c.

993  {
994  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
995  if (__first != __last) {
997  _STLP_VALUE_TYPE(__first, _RandomAccessIter),
998  _STLP_PRIV __lg(__last - __first) * 2,
999  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _RandomAccessIter)));
1001  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _RandomAccessIter)));
1002  }
1003 }
void __introsort_loop(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Size __depth_limit, _Compare __comp)
Definition: _algo.c:970
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
void __final_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
Definition: _algo.c:959
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_PRIV_NAMESPACE _Size __lg(_Size __n)
Definition: _algo.h:409

Referenced by _Function_class_(), BnegateTest::bnegate1(), BnegateTest::bnegate2(), LocaleTest::collate_by_name(), LocaleTest::collate_facet(), FindProgramDlg::CompareFunc(), CountUniqueItems_Aux(), DoSort(), FuncTest::func2(), FuncTest::func3(), CDefView::GetArrangeParam(), GreaterTest::greatereq(), GreaterTest::greatert(), IncludesTest::incl2(), LessTest::lesseqt(), LessTest::lesst(), ListView_SortEx(), BtrfsDeviceAdd::populate_device_tree(), SortBuffer::PrepareMerge(), PrintBugreport(), psh_hint_table_activate_mask(), psh_hint_table_find_strong_points(), CDefView::Rearrange(), should_balance_chunk(), SortTest::sort1(), SortTest::sort2(), SortTest::sort3(), AlgTest::sort_test(), test_GetDefaultColumn(), test_ldap_parse_sort_control(), UnorderedTest::umap(), UnorderedTest::umultimap(), UnorderedTest::umultiset(), UnorderedTest::uset(), and xsltComputeSortResult().

◆ sort() [2/2]

template<class _RandomAccessIter , class _Compare >
void sort ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Compare  __comp 
)

Definition at line 1006 of file _algo.c.

1006  {
1007  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1008  if (__first != __last) {
1010  _STLP_VALUE_TYPE(__first, _RandomAccessIter),
1011  _STLP_PRIV __lg(__last - __first) * 2, __comp);
1012  _STLP_PRIV __final_insertion_sort(__first, __last, __comp);
1013  }
1014 }
void __introsort_loop(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Size __depth_limit, _Compare __comp)
Definition: _algo.c:970
void __final_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
Definition: _algo.c:959
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_STLP_MOVE_TO_PRIV_NAMESPACE _Size __lg(_Size __n)
Definition: _algo.h:409

◆ stable_partition()

template<class _ForwardIter , class _Predicate >
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter stable_partition ( _ForwardIter  __first,
_ForwardIter  __last,
_Predicate  __pred 
)

Definition at line 866 of file _algo.c.

866  {
867  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
868  for (;;) {
869  if (__first == __last)
870  return __first;
871  else if (__pred(*__first))
872  ++__first;
873  else
874  break;
875  }
877  _STLP_ITERATOR_CATEGORY(__first, _ForwardIter));
878 }
_STLP_INLINE_LOOP _InputIter _Predicate __pred
Definition: _algo.h:68
#define _STLP_ITERATOR_CATEGORY(_It, _Tp)
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_ForwardIter __stable_partition_aux(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, const forward_iterator_tag &)
Definition: _algo.c:827

Referenced by test_stable_partition::operator()(), PartitionTest::stblptn0(), and PartitionTest::stblptn1().

◆ stable_sort() [1/2]

template<class _RandomAccessIter >
_STLP_MOVE_TO_STD_NAMESPACE void stable_sort ( _RandomAccessIter  __first,
_RandomAccessIter  __last 
)

Definition at line 1197 of file _algo.c.

1198  {
1199  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1201  _STLP_VALUE_TYPE(__first, _RandomAccessIter),
1202  _STLP_DISTANCE_TYPE(__first, _RandomAccessIter),
1203  _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _RandomAccessIter)));
1204 }
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
void __stable_sort_aux(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Distance *, _Compare __comp)
Definition: _algo.c:1182
#define _STLP_DISTANCE_TYPE(_It, _Tp)

Referenced by test_stable_sort_1::operator()(), test_stable_sort_2::operator()(), SortTest::stblsrt1(), and SortTest::stblsrt2().

◆ stable_sort() [2/2]

template<class _RandomAccessIter , class _Compare >
void stable_sort ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_Compare  __comp 
)

Definition at line 1207 of file _algo.c.

1208  {
1209  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
1211  _STLP_VALUE_TYPE(__first, _RandomAccessIter),
1212  _STLP_DISTANCE_TYPE(__first, _RandomAccessIter),
1213  __comp);
1214 }
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
void __stable_sort_aux(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Distance *, _Compare __comp)
Definition: _algo.c:1182
#define _STLP_DISTANCE_TYPE(_It, _Tp)

◆ unique_copy() [1/2]

template<class _InputIter , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter unique_copy ( _InputIter  __first,
_InputIter  __last,
_OutputIter  __result 
)

Definition at line 348 of file _algo.c.

348  {
349  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
350  if (__first == __last) return __result;
351  return _STLP_PRIV __unique_copy(__first, __last, __result,
352  _STLP_PRIV __equal_to(_STLP_VALUE_TYPE(__first, _InputIter)),
353  _STLP_ITERATOR_CATEGORY(__result, _OutputIter));
354 }
equal_to< _Tp > __equal_to(_Tp *)
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _OutputIterator __unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __binary_pred, _Tp *)
Definition: _algo.c:295
#define _STLP_ITERATOR_CATEGORY(_It, _Tp)
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440

Referenced by UniqueTest::uniqcpy1(), UniqueTest::uniqcpy2(), and unique().

◆ unique_copy() [2/2]

template<class _InputIter , class _OutputIter , class _BinaryPredicate >
_OutputIter unique_copy ( _InputIter  __first,
_InputIter  __last,
_OutputIter  __result,
_BinaryPredicate  __binary_pred 
)

Definition at line 358 of file _algo.c.

359  {
360  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
361  if (__first == __last) return __result;
362  return _STLP_PRIV __unique_copy(__first, __last, __result, __binary_pred,
363  _STLP_ITERATOR_CATEGORY(__result, _OutputIter));
364 }
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _OutputIterator __unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __binary_pred, _Tp *)
Definition: _algo.c:295
#define _STLP_ITERATOR_CATEGORY(_It, _Tp)
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
#define _STLP_PRIV
Definition: _dm.h:70
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440

Variable Documentation

◆ __stl_chunk_size

const int __stl_chunk_size = 7

Definition at line 1058 of file _algo.c.

Referenced by __merge_sort_with_buffer().