ReactOS 0.4.15-dev-7788-g1ad9096
_algobase.h File Reference
#include <stl/_cstddef.h>
#include <stl/_cstring.h>
#include <climits>
#include <stl/_cstdlib.h>
#include <stl/_pair.h>
#include <stl/_iterator_base.h>
#include <stl/type_traits.h>
#include <stl/_algobase.c>
Include dependency graph for _algobase.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _STLP_DECLARE_COPY_TRIVIAL(_Tp)
 

Functions

template<class _Tp >
_STLP_BEGIN_NAMESPACE void swap (_Tp &__a, _Tp &__b)
 
template<class _ForwardIter1 , class _ForwardIter2 , class _Value >
_STLP_MOVE_TO_PRIV_NAMESPACE void __iter_swap_aux_aux (_ForwardIter1 &__i1, _ForwardIter2 &__i2, _Value *)
 
template<class _ForwardIter1 , class _ForwardIter2 >
void __iter_swap_aux (_ForwardIter1 &__i1, _ForwardIter2 &__i2, const __true_type &)
 
template<class _ForwardIter1 , class _ForwardIter2 >
void __iter_swap_aux (_ForwardIter1 &__i1, _ForwardIter2 &__i2, const __false_type &)
 
template<class _ForwardIter1 , class _ForwardIter2 >
_STLP_MOVE_TO_STD_NAMESPACE void iter_swap (_ForwardIter1 __i1, _ForwardIter2 __i2)
 
template<class _Tp >
const _Tp &() min (const _Tp &__a, const _Tp &__b)
 
template<class _Tp >
const _Tp &() max (const _Tp &__a, const _Tp &__b)
 
template<class _Tp , class _Compare >
const _Tp &() min (const _Tp &__a, const _Tp &__b, _Compare __comp)
 
template<class _Tp , class _Compare >
const _Tp &() max (const _Tp &__a, const _Tp &__b, _Compare __comp)
 
template<class _InputIter , class _OutputIter , class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __copy (_InputIter __first, _InputIter __last, _OutputIter __result, const input_iterator_tag &, _Distance *)
 
template<class _RandomAccessIter , class _OutputIter , class _Distance >
_OutputIter __copy (_RandomAccessIter __first, _RandomAccessIter __last, _OutputIter __result, const random_access_iterator_tag &, _Distance *)
 
void__copy_trivial (const void *__first, const void *__last, void *__result)
 
template<class _BidirectionalIter1 , class _BidirectionalIter2 , class _Distance >
_BidirectionalIter2 __copy_backward (_BidirectionalIter1 __first, _BidirectionalIter1 __last, _BidirectionalIter2 __result, const bidirectional_iterator_tag &, _Distance *)
 
template<class _RandomAccessIter , class _BidirectionalIter , class _Distance >
_BidirectionalIter __copy_backward (_RandomAccessIter __first, _RandomAccessIter __last, _BidirectionalIter __result, const random_access_iterator_tag &, _Distance *)
 
void__copy_trivial_backward (const void *__first, const void *__last, void *__result)
 
template<class _InputIter , class _OutputIter >
_OutputIter __copy_ptrs (_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type &)
 
template<class _InputIter , class _OutputIter >
_OutputIter __copy_ptrs (_InputIter __first, _InputIter __last, _OutputIter __result, const __true_type &)
 
template<class _InputIter , class _OutputIter >
_OutputIter __copy_aux (_InputIter __first, _InputIter __last, _OutputIter __result, const __true_type &)
 
template<class _InputIter , class _OutputIter >
_OutputIter __copy_aux (_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type &)
 
template<class _InputIter , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter copy (_InputIter __first, _InputIter __last, _OutputIter __result)
 
template<class _InputIter , class _OutputIter >
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __copy_backward_ptrs (_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type &)
 
template<class _InputIter , class _OutputIter >
_OutputIter __copy_backward_ptrs (_InputIter __first, _InputIter __last, _OutputIter __result, const __true_type &)
 
template<class _InputIter , class _OutputIter >
_OutputIter __copy_backward_aux (_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type &)
 
template<class _InputIter , class _OutputIter >
_OutputIter __copy_backward_aux (_InputIter __first, _InputIter __last, _OutputIter __result, const __true_type &)
 
template<class _InputIter , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter copy_backward (_InputIter __first, _InputIter __last, _OutputIter __result)
 
template<class _InputIter , class _Size , class _OutputIter >
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _STLP_STD::pair< _InputIter, _OutputIter > __copy_n (_InputIter __first, _Size __count, _OutputIter __result, const input_iterator_tag &)
 
template<class _RAIter , class _Size , class _OutputIter >
_STLP_STD::pair< _RAIter, _OutputIter > __copy_n (_RAIter __first, _Size __count, _OutputIter __result, const random_access_iterator_tag &)
 
template<class _InputIter , class _Size , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE pair< _InputIter, _OutputIter > copy_n (_InputIter __first, _Size __count, _OutputIter __result)
 
template<class _ForwardIter , class _Tp >
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP void __fill_fwd (_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
 
template<class _ForwardIter , class _Tp , class _Distance >
void __fill (_ForwardIter __first, _ForwardIter __last, const _Tp &__val, const input_iterator_tag &, _Distance *)
 
template<class _RandomAccessIter , class _Tp , class _Distance >
_STLP_INLINE_LOOP void __fill (_RandomAccessIter __first, _RandomAccessIter __last, const _Tp &__val, const random_access_iterator_tag &, _Distance *)
 
template<class _ForwardIter , class _Tp >
_STLP_MOVE_TO_STD_NAMESPACE void fill (_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
 
void fill (unsigned char *__first, unsigned char *__last, const unsigned char &__val)
 
void fill (signed char *__first, signed char *__last, const signed char &__val)
 
void fill (char *__first, char *__last, const char &__val)
 
template<class _OutputIter , class _Size , class _Tp >
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _OutputIter __fill_n (_OutputIter __first, _Size __n, const _Tp &__val)
 
template<class _OutputIter , class _Size , class _Tp >
_STLP_MOVE_TO_STD_NAMESPACE void fill_n (_OutputIter __first, _Size __n, const _Tp &__val)
 
template<class _InputIter1 , class _InputIter2 >
_STLP_INLINE_LOOP _STLP_STD::pair< _InputIter1, _InputIter2 > mismatch (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2)
 
template<class _InputIter1 , class _InputIter2 , class _BinaryPredicate >
_STLP_INLINE_LOOP _STLP_STD::pair< _InputIter1, _InputIter2 > mismatch (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _BinaryPredicate __binary_pred)
 
template<class _InputIter1 , class _InputIter2 >
_STLP_INLINE_LOOP bool equal (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2)
 
template<class _InputIter1 , class _InputIter2 , class _BinaryPredicate >
_STLP_INLINE_LOOP bool equal (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _BinaryPredicate __binary_pred)
 
template<class _InputIter1 , class _InputIter2 >
bool lexicographical_compare (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2)
 
template<class _InputIter1 , class _InputIter2 , class _Compare >
bool lexicographical_compare (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _Compare __comp)
 
bool lexicographical_compare (const unsigned char *__first1, const unsigned char *__last1, const unsigned char *__first2, const unsigned char *__last2)
 
template<class _InputIter1 , class _InputIter2 >
_STLP_MOVE_TO_PRIV_NAMESPACE int __lexicographical_compare_3way (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2)
 
int __lexicographical_compare_3way (const unsigned char *__first1, const unsigned char *__last1, const unsigned char *__first2, const unsigned char *__last2)
 
template<class _InputIter1 , class _InputIter2 >
_STLP_MOVE_TO_STD_NAMESPACE int lexicographical_compare_3way (_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2)
 
template<class _InputIter , class _Tp >
_STLP_INLINE_LOOP _STLP_DIFFERENCE_TYPE (_InputIter) count(_InputIter __first
 
 for (;__first !=__last;++__first) if(*__first
 
template<class _InputIter , class _Tp >
_InputIter find (_InputIter __first, _InputIter __last, const _Tp &__val)
 
template<class _InputIter , class _Predicate >
_InputIter find_if (_InputIter __first, _InputIter __last, _Predicate __pred)
 
template<class _ForwardIter1 , class _ForwardIter2 , class _BinaryPred >
_ForwardIter1 search (_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2, _BinaryPred __predicate)
 
template<class _InputIter , class _ForwardIter >
_STLP_MOVE_TO_PRIV_NAMESPACE _InputIter __find_first_of (_InputIter __first1, _InputIter __last1, _ForwardIter __first2, _ForwardIter __last2)
 
template<class _InputIter , class _ForwardIter , class _BinaryPredicate >
_InputIter __find_first_of (_InputIter __first1, _InputIter __last1, _ForwardIter __first2, _ForwardIter __last2, _BinaryPredicate __comp)
 
template<class _ForwardIter1 , class _ForwardIter2 , class _BinaryPredicate >
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter1 find_end (_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2, _BinaryPredicate __comp)
 
template<class _ForwardIter , class _Tp >
_STLP_INLINE_LOOP void replace (_ForwardIter __first, _ForwardIter __last, const _Tp &__old_value, const _Tp &__new_value)
 
template<class _ForwardIter , class _Tp , class _Compare1 , class _Compare2 , class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __lower_bound (_ForwardIter __first, _ForwardIter __last, const _Tp &__val, _Compare1 __comp1, _Compare2 __comp2, _Distance *)
 

Variables

_STLP_INLINE_LOOP _InputIter __last
 
_STLP_INLINE_LOOP _InputIter const _Tp & __val
 
return __n
 

Macro Definition Documentation

◆ _STLP_DECLARE_COPY_TRIVIAL

#define _STLP_DECLARE_COPY_TRIVIAL (   _Tp)
Value:
inline _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) \
{ return (_Tp*)_STLP_PRIV __copy_trivial(__first, __last, __result); } \
inline _Tp* copy_backward(const _Tp* __first, const _Tp* __last, _Tp* __result) \
{ return (_Tp*)_STLP_PRIV __copy_trivial_backward(__first, __last, __result); }
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter copy(_InputIter __first, _InputIter __last, _OutputIter __result)
Definition: _algobase.h:291
_STLP_INLINE_LOOP _InputIter __last
Definition: _algobase.h:656
void * __copy_trivial(const void *__first, const void *__last, void *__result)
Definition: _algobase.h:222
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter copy_backward(_InputIter __first, _InputIter __last, _OutputIter __result)
Definition: _algobase.h:328
void * __copy_trivial_backward(const void *__first, const void *__last, void *__result)
Definition: _algobase.h:254
#define _STLP_PRIV
Definition: _dm.h:70

Definition at line 334 of file _algobase.h.

Function Documentation

◆ __copy() [1/2]

template<class _InputIter , class _OutputIter , class _Distance >
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __copy ( _InputIter  __first,
_InputIter  __last,
_OutputIter  __result,
const input_iterator_tag ,
_Distance *   
)
inline

Definition at line 184 of file _algobase.h.

185 {
186 for ( ; __first != __last; ++__result, ++__first)
187 *__result = *__first;
188 return __result;
189}

Referenced by __copy_aux(), and __copy_ptrs().

◆ __copy() [2/2]

template<class _RandomAccessIter , class _OutputIter , class _Distance >
_OutputIter __copy ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_OutputIter  __result,
const random_access_iterator_tag ,
_Distance *   
)
inline

Definition at line 211 of file _algobase.h.

212 {
213 for (_Distance __n = __last - __first; __n > 0; --__n) {
214 *__result = *__first;
215 ++__first;
216 ++__result;
217 }
218 return __result;
219}
return __n
Definition: _algobase.h:662

◆ __copy_aux() [1/2]

template<class _InputIter , class _OutputIter >
_OutputIter __copy_aux ( _InputIter  __first,
_InputIter  __last,
_OutputIter  __result,
const __false_type  
)
inline

Definition at line 281 of file _algobase.h.

282 {
283 return _STLP_PRIV __copy(__first, __last, __result,
284 _STLP_ITERATOR_CATEGORY(__first, _InputIter),
285 _STLP_DISTANCE_TYPE(__first, _InputIter));
286}
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __copy(_InputIter __first, _InputIter __last, _OutputIter __result, const input_iterator_tag &, _Distance *)
Definition: _algobase.h:184
#define _STLP_ITERATOR_CATEGORY(_It, _Tp)
#define _STLP_DISTANCE_TYPE(_It, _Tp)

◆ __copy_aux() [2/2]

template<class _InputIter , class _OutputIter >
_OutputIter __copy_aux ( _InputIter  __first,
_InputIter  __last,
_OutputIter  __result,
const __true_type  
)
inline

Definition at line 273 of file _algobase.h.

274 {
275 return _STLP_PRIV __copy_ptrs(__first, __last, __result,
276 _UseTrivialCopy(_STLP_VALUE_TYPE(__first, _InputIter),
277 _STLP_VALUE_TYPE(__result, _OutputIter))._Answer());
278}
_OutputIter __copy_ptrs(_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type &)
Definition: _algobase.h:260
#define _STLP_VALUE_TYPE(_It, _Tp)
_TrivialCopy< _Src, _Dst > _UseTrivialCopy(_Src *, _Dst *)
Definition: type_traits.h:501

Referenced by copy().

◆ __copy_backward() [1/2]

template<class _BidirectionalIter1 , class _BidirectionalIter2 , class _Distance >
_BidirectionalIter2 __copy_backward ( _BidirectionalIter1  __first,
_BidirectionalIter1  __last,
_BidirectionalIter2  __result,
const bidirectional_iterator_tag ,
_Distance *   
)
inline

Definition at line 232 of file _algobase.h.

236 {
237 while (__first != __last)
238 *--__result = *--__last;
239 return __result;
240}

Referenced by __copy_backward_aux(), __copy_backward_ptrs(), __BVECTOR_QUALIFIED::_M_fill_insert(), __BVECTOR_QUALIFIED::_M_insert_aux(), and __BVECTOR_QUALIFIED::insert().

◆ __copy_backward() [2/2]

template<class _RandomAccessIter , class _BidirectionalIter , class _Distance >
_BidirectionalIter __copy_backward ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
_BidirectionalIter  __result,
const random_access_iterator_tag ,
_Distance *   
)
inline

Definition at line 243 of file _algobase.h.

247 {
248 for (_Distance __n = __last - __first; __n > 0; --__n)
249 *--__result = *--__last;
250 return __result;
251}

◆ __copy_backward_aux() [1/2]

template<class _InputIter , class _OutputIter >
_OutputIter __copy_backward_aux ( _InputIter  __first,
_InputIter  __last,
_OutputIter  __result,
const __false_type  
)
inline

Definition at line 312 of file _algobase.h.

312 {
313 return _STLP_PRIV __copy_backward(__first, __last, __result,
314 _STLP_ITERATOR_CATEGORY(__first,_InputIter),
315 _STLP_DISTANCE_TYPE(__first, _InputIter));
316}
_BidirectionalIter2 __copy_backward(_BidirectionalIter1 __first, _BidirectionalIter1 __last, _BidirectionalIter2 __result, const bidirectional_iterator_tag &, _Distance *)
Definition: _algobase.h:232

Referenced by copy_backward().

◆ __copy_backward_aux() [2/2]

template<class _InputIter , class _OutputIter >
_OutputIter __copy_backward_aux ( _InputIter  __first,
_InputIter  __last,
_OutputIter  __result,
const __true_type  
)
inline

Definition at line 319 of file _algobase.h.

319 {
320 return _STLP_PRIV __copy_backward_ptrs(__first, __last, __result,
321 _UseTrivialCopy(_STLP_VALUE_TYPE(__first, _InputIter),
322 _STLP_VALUE_TYPE(__result, _OutputIter))._Answer());
323}
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __copy_backward_ptrs(_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type &)
Definition: _algobase.h:299

◆ __copy_backward_ptrs() [1/2]

template<class _InputIter , class _OutputIter >
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __copy_backward_ptrs ( _InputIter  __first,
_InputIter  __last,
_OutputIter  __result,
const __false_type  
)
inline

Definition at line 299 of file _algobase.h.

300 {
301 return _STLP_PRIV __copy_backward(__first, __last, __result,
302 _STLP_ITERATOR_CATEGORY(__first, _InputIter),
303 _STLP_DISTANCE_TYPE(__first, _InputIter));
304}

Referenced by __copy_backward_aux(), and vector< _Tp, >::_M_range_insert_aux().

◆ __copy_backward_ptrs() [2/2]

template<class _InputIter , class _OutputIter >
_OutputIter __copy_backward_ptrs ( _InputIter  __first,
_InputIter  __last,
_OutputIter  __result,
const __true_type  
)
inline

Definition at line 306 of file _algobase.h.

307 {
308 return (_OutputIter)_STLP_PRIV __copy_trivial_backward(__first, __last, __result);
309}

◆ __copy_n() [1/2]

template<class _InputIter , class _Size , class _OutputIter >
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _STLP_STD::pair< _InputIter, _OutputIter > __copy_n ( _InputIter  __first,
_Size  __count,
_OutputIter  __result,
const input_iterator_tag  
)

Definition at line 377 of file _algobase.h.

378 {
379 for ( ; __count > 0; --__count) {
380 *__result = *__first;
381 ++__first;
382 ++__result;
383 }
384 return _STLP_STD::pair<_InputIter, _OutputIter>(__first, __result);
385}

Referenced by copy_n().

◆ __copy_n() [2/2]

template<class _RAIter , class _Size , class _OutputIter >
_STLP_STD::pair< _RAIter, _OutputIter > __copy_n ( _RAIter  __first,
_Size  __count,
_OutputIter  __result,
const random_access_iterator_tag  
)
inline

Definition at line 389 of file _algobase.h.

390 {
391 _RAIter __last = __first + __count;
392 return _STLP_STD::pair<_RAIter, _OutputIter>(__last, _STLP_STD::copy(__first, __last, __result));
393}

◆ __copy_ptrs() [1/2]

template<class _InputIter , class _OutputIter >
_OutputIter __copy_ptrs ( _InputIter  __first,
_InputIter  __last,
_OutputIter  __result,
const __false_type  
)
inline

Definition at line 260 of file _algobase.h.

261 {
262 return _STLP_PRIV __copy(__first, __last, __result, random_access_iterator_tag(), (ptrdiff_t*)0);
263}
#define random_access_iterator_tag
Definition: _abbrevs.h:28
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247

Referenced by __copy_aux(), vector< _Tp, >::_M_erase(), and vector< _Tp, >::operator=().

◆ __copy_ptrs() [2/2]

template<class _InputIter , class _OutputIter >
_OutputIter __copy_ptrs ( _InputIter  __first,
_InputIter  __last,
_OutputIter  __result,
const __true_type  
)
inline

Definition at line 265 of file _algobase.h.

266 {
267 // we know they all pointers, so this cast is OK
268 // return (_OutputIter)__copy_trivial(&(*__first), &(*__last), &(*__result));
269 return (_OutputIter)_STLP_PRIV __copy_trivial(__first, __last, __result);
270}

◆ __copy_trivial()

void * __copy_trivial ( const void __first,
const void __last,
void __result 
)
inline

Definition at line 222 of file _algobase.h.

222 {
223 size_t __n = (const char*)__last - (const char*)__first;
224 return __n ? (void *)((char*)memmove(__result, __first, __n) + __n) : __result;
225}
#define memmove(s1, s2, n)
Definition: mkisofs.h:881

Referenced by __copy_ptrs(), and vector< _Tp, >::_M_insert_overflow().

◆ __copy_trivial_backward()

void * __copy_trivial_backward ( const void __first,
const void __last,
void __result 
)
inline

Definition at line 254 of file _algobase.h.

254 {
255 const ptrdiff_t _Num = (const char*)__last - (const char*)__first;
256 return (_Num > 0) ? memmove((char*)__result - _Num, __first, _Num) : __result ;
257}

Referenced by __copy_backward_ptrs().

◆ __fill() [1/2]

template<class _ForwardIter , class _Tp , class _Distance >
void __fill ( _ForwardIter  __first,
_ForwardIter  __last,
const _Tp &  __val,
const input_iterator_tag ,
_Distance *   
)
inline

◆ __fill() [2/2]

template<class _RandomAccessIter , class _Tp , class _Distance >
_STLP_INLINE_LOOP void __fill ( _RandomAccessIter  __first,
_RandomAccessIter  __last,
const _Tp &  __val,
const random_access_iterator_tag ,
_Distance *   
)

Definition at line 440 of file _algobase.h.

441 {
442 for (_Distance __n = __last - __first ; __n > 0; ++__first, --__n)
443 *__first = __val;
444}

◆ __fill_fwd()

template<class _ForwardIter , class _Tp >
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP void __fill_fwd ( _ForwardIter  __first,
_ForwardIter  __last,
const _Tp &  __val 
)

Definition at line 411 of file _algobase.h.

411 {
412 for ( ; __first != __last; ++__first)
413 *__first = __val;
414}

Referenced by __fill().

◆ __fill_n()

template<class _OutputIter , class _Size , class _Tp >
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _OutputIter __fill_n ( _OutputIter  __first,
_Size  __n,
const _Tp &  __val 
)

Definition at line 478 of file _algobase.h.

478 {
479 _STLP_FIX_LITERAL_BUG(__first)
480 for ( ; __n > 0; --__n, ++__first)
481 *__first = __val;
482 return __first;
483}
#define _STLP_FIX_LITERAL_BUG(__x)
Definition: features.h:301

Referenced by __copy_float_and_fill(), __copy_integer_and_fill(), __do_put_bool(), __money_do_put(), vector< _Tp, >::_M_fill_assign(), vector< _Tp, >::_M_insert_overflow(), and fill_n().

◆ __find_first_of() [1/2]

template<class _InputIter , class _ForwardIter >
_STLP_MOVE_TO_PRIV_NAMESPACE _InputIter __find_first_of ( _InputIter  __first1,
_InputIter  __last1,
_ForwardIter  __first2,
_ForwardIter  __last2 
)
inline

Definition at line 339 of file _algobase.c.

340 {
341 return _STLP_PRIV __find_first_of_aux1(__first1, __last1, __first2, __last2,
342 _STLP_VALUE_TYPE(__first1, _InputIter),
343 _STLP_VALUE_TYPE(__first2, _ForwardIter));
344}
_InputIter __find_first_of_aux1(_InputIter __first1, _InputIter __last1, _ForwardIter __first2, _ForwardIter __last2, _Tp1 *__pt1, _Tp2 *__pt2)
Definition: _algobase.c:327

Referenced by __find_first_of_aux2(), __str_find_first_of_aux(), and find_first_of().

◆ __find_first_of() [2/2]

template<class _InputIter , class _ForwardIter , class _BinaryPredicate >
_InputIter __find_first_of ( _InputIter  __first1,
_InputIter  __last1,
_ForwardIter  __first2,
_ForwardIter  __last2,
_BinaryPredicate  __comp 
)

Definition at line 348 of file _algobase.c.

350 {
351 for ( ; __first1 != __last1; ++__first1) {
352 for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter) {
353 if (__comp(*__first1, *__iter)) {
354 return __first1;
355 }
356 }
357 }
358 return __last1;
359}

◆ __iter_swap_aux() [1/2]

template<class _ForwardIter1 , class _ForwardIter2 >
void __iter_swap_aux ( _ForwardIter1 &  __i1,
_ForwardIter2 &  __i2,
const __false_type  
)
inline

Definition at line 113 of file _algobase.h.

113 {
114 _STLP_PRIV __iter_swap_aux_aux( __i1, __i2, _STLP_VALUE_TYPE(__i1,_ForwardIter1) );
115}
_STLP_MOVE_TO_PRIV_NAMESPACE void __iter_swap_aux_aux(_ForwardIter1 &__i1, _ForwardIter2 &__i2, _Value *)
Definition: _algobase.h:100

◆ __iter_swap_aux() [2/2]

template<class _ForwardIter1 , class _ForwardIter2 >
void __iter_swap_aux ( _ForwardIter1 &  __i1,
_ForwardIter2 &  __i2,
const __true_type  
)
inline

Definition at line 107 of file _algobase.h.

107 {
108 /* namespace specification breaks access to the right swap template overload (at least for gcc) */
109 /*_STLP_STD::*/ swap(*__i1, *__i2);
110}
#define swap(a, b)
Definition: qsort.c:63

Referenced by iter_swap().

◆ __iter_swap_aux_aux()

template<class _ForwardIter1 , class _ForwardIter2 , class _Value >
_STLP_MOVE_TO_PRIV_NAMESPACE void __iter_swap_aux_aux ( _ForwardIter1 &  __i1,
_ForwardIter2 &  __i2,
_Value  
)
inline

Definition at line 100 of file _algobase.h.

100 {
101 _Value tmp = *__i1;
102 *__i1 = *__i2;
103 *__i2 = tmp;
104}
int _Value
Definition: setjmp.h:214

Referenced by __iter_swap_aux().

◆ __lexicographical_compare_3way() [1/2]

template<class _InputIter1 , class _InputIter2 >
_STLP_MOVE_TO_PRIV_NAMESPACE int __lexicographical_compare_3way ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2 
)

Definition at line 78 of file _algobase.c.

79 {
80 while (__first1 != __last1 && __first2 != __last2) {
81 if (*__first1 < *__first2) {
82 _STLP_VERBOSE_ASSERT(!(*__first2 < *__first1), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
83 return -1;
84 }
85 if (*__first2 < *__first1)
86 return 1;
87 ++__first1;
88 ++__first2;
89 }
90 if (__first2 == __last2) {
91 return !(__first1 == __last1);
92 }
93 else {
94 return -1;
95 }
96}
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
Definition: _debug.h:439

Referenced by rope< _CharT, _Alloc >::_S_compare(), collate< char >::do_compare(), collate< wchar_t >::do_compare(), and lexicographical_compare_3way().

◆ __lexicographical_compare_3way() [2/2]

int __lexicographical_compare_3way ( const unsigned char __first1,
const unsigned char __last1,
const unsigned char __first2,
const unsigned char __last2 
)
inline

Definition at line 621 of file _algobase.h.

624 {
625 const ptrdiff_t __len1 = __last1 - __first1;
626 const ptrdiff_t __len2 = __last2 - __first2;
627 const int __result = memcmp(__first1, __first2, (min) (__len1, __len2));
628 return __result != 0 ? __result
629 : (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1));
630}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define min(a, b)
Definition: monoChain.cc:55

◆ __lower_bound()

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

Definition at line 453 of file _algobase.c.

454 {
455 _Distance __len = _STLP_STD::distance(__first, __last);
456 _Distance __half;
457 _ForwardIter __middle;
458
459 while (__len > 0) {
460 __half = __len >> 1;
461 __middle = __first;
462 _STLP_STD::advance(__middle, __half);
463 if (__comp1(*__middle, __val)) {
464 _STLP_VERBOSE_ASSERT(!__comp2(__val, *__middle), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
465 __first = __middle;
466 ++__first;
467 __len = __len - __half - 1;
468 }
469 else
470 __len = __half;
471 }
472 return __first;
473}
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68

Referenced by __equal_range(), binary_search(), and lower_bound().

◆ _STLP_DIFFERENCE_TYPE()

template<class _InputIter , class _Tp >
_STLP_INLINE_LOOP _STLP_DIFFERENCE_TYPE ( _InputIter  )

◆ copy()

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

Definition at line 291 of file _algobase.h.

291 {
292 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
294}
_OutputIter __copy_aux(_InputIter __first, _InputIter __last, _OutputIter __result, const __true_type &)
Definition: _algobase.h:273
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440

◆ copy_backward()

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

Definition at line 328 of file _algobase.h.

328 {
329 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
331}
_OutputIter __copy_backward_aux(_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type &)
Definition: _algobase.h:312

Referenced by __insert_grouping_aux(), __linear_insert(), __merge_backward(), deque< _Tp, >::_M_erase(), deque< _Tp, >::_M_fill_insert_aux(), CopyTest::copy_back(), and CopyTest::copy_back_array().

◆ copy_n()

template<class _InputIter , class _Size , class _OutputIter >
_STLP_MOVE_TO_STD_NAMESPACE pair< _InputIter, _OutputIter > copy_n ( _InputIter  __first,
_Size  __count,
_OutputIter  __result 
)
inline

Definition at line 399 of file _algobase.h.

399 {
400 _STLP_FIX_LITERAL_BUG(__first)
401 return _STLP_PRIV __copy_n(__first, __count, __result, _STLP_ITERATOR_CATEGORY(__first, _InputIter));
402}
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _STLP_STD::pair< _InputIter, _OutputIter > __copy_n(_InputIter __first, _Size __count, _OutputIter __result, const input_iterator_tag &)
Definition: _algobase.h:377

Referenced by IStreamIteratorTest::copy_n_test().

◆ equal() [1/2]

template<class _InputIter1 , class _InputIter2 >
_STLP_INLINE_LOOP bool equal ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2 
)

Definition at line 551 of file _algobase.h.

552 {
554 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
555 for ( ; __first1 != __last1; ++__first1, ++__first2)
556 if (!(*__first1 == *__first2))
557 return false;
558 return true;
559}

◆ equal() [2/2]

template<class _InputIter1 , class _InputIter2 , class _BinaryPredicate >
_STLP_INLINE_LOOP bool equal ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_BinaryPredicate  __binary_pred 
)

Definition at line 563 of file _algobase.h.

564 {
565 _STLP_FIX_LITERAL_BUG(__first2)
566 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
567 for ( ; __first1 != __last1; ++__first1, ++__first2)
568 if (!__binary_pred(*__first1, *__first2))
569 return false;
570 return true;
571}

◆ fill() [1/4]

template<class _ForwardIter , class _Tp >
_STLP_MOVE_TO_STD_NAMESPACE void fill ( _ForwardIter  __first,
_ForwardIter  __last,
const _Tp &  __val 
)
inline

Definition at line 449 of file _algobase.h.

449 {
450 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
451 _STLP_PRIV __fill(__first, __last, __val,
452 _STLP_ITERATOR_CATEGORY(__first, _ForwardIter),
453 _STLP_DISTANCE_TYPE(__first, _ForwardIter));
454}
void __fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__val, const input_iterator_tag &, _Distance *)
Definition: _algobase.h:417

Referenced by __BVECTOR_QUALIFIED::__BVECTOR(), hashtable< _Val, _Key, _HF, _Traits, _ExK, _EqK, _All >::_M_copy_from(), _Base_bitset< _Nw >::_M_do_left_shift(), _Base_bitset< _Nw >::_M_do_right_shift(), __BVECTOR_QUALIFIED::_M_fill_assign(), vector< _Tp, >::_M_fill_assign(), __BVECTOR_QUALIFIED::_M_fill_insert(), deque< _Tp, >::_M_fill_insert_aux(), hashtable< _Val, _Key, _HF, _Traits, _ExK, _EqK, _All >::_M_insert_noresize(), basic_ostream< _CharT, _Traits >::_M_put_char(), basic_ostream< _CharT, _Traits >::_M_put_nowiden(), basic_ostream< _CharT, _Traits >::_M_put_widen(), hashtable< _Val, _Key, _HF, _Traits, _ExK, _EqK, _All >::_M_rehash(), _Stl_expand_array(), blake2b_update(), brush_fill_path(), brush_fill_pixels(), create_table(), TConsole::DeleteCharacter(), CardButton::DrawRect(), hashtable< _Val, _Key, _HF, _Traits, _ExK, _EqK, _All >::erase(), fi_set(), FillTest::fill1(), GdipCreateAdjustableArrowCap(), GdipCreatePath(), GdipCreatePath2(), GdipCreatePath2I(), GdipFillClosedCurve2(), GdipFillClosedCurve2I(), GdipGetAdjustableArrowCapFillState(), GdipPlayMetafileRecord(), GdipSetAdjustableArrowCapFillState(), GdipSetPathFillMode(), SolidBrush::GetColor(), inflate_table(), init_custom_linecap(), TConsole::InsertCharacter(), TConsole::InsertLine(), make_decode_table(), mpg123_copy_string(), mpg123_index(), mpg123_set_index(), SolidBrush::SetColor(), test_crc2_imp(), ui_ellipse(), ui_patblt(), ui_polygon(), and UniqueTest::uniqcpy2().

◆ fill() [2/4]

void fill ( char __first,
char __last,
const char __val 
)
inline

Definition at line 469 of file _algobase.h.

469 {
470 char __tmp = __val;
471 memset(__first, __STATIC_CAST(unsigned char,__tmp), __last - __first);
472}
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
#define memset(x, y, z)
Definition: compat.h:39

◆ fill() [3/4]

void fill ( signed char __first,
signed char __last,
const signed char __val 
)
inline

Definition at line 463 of file _algobase.h.

464 {
465 signed char __tmp = __val;
466 memset(__first, __STATIC_CAST(unsigned char,__tmp), __last - __first);
467}

◆ fill() [4/4]

void fill ( unsigned char __first,
unsigned char __last,
const unsigned char __val 
)
inline

Definition at line 457 of file _algobase.h.

458 {
459 unsigned char __tmp = __val;
460 memset(__first, __tmp, __last - __first);
461}

◆ fill_n()

template<class _OutputIter , class _Size , class _Tp >
_STLP_MOVE_TO_STD_NAMESPACE void fill_n ( _OutputIter  __first,
_Size  __n,
const _Tp &  __val 
)
inline

Definition at line 511 of file _algobase.h.

511 {
512 _STLP_FIX_LITERAL_BUG(__first)
513 _STLP_PRIV __fill_n(__first, __n, __val);
514}
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _OutputIter __fill_n(_OutputIter __first, _Size __n, const _Tp &__val)
Definition: _algobase.h:478

Referenced by __BVECTOR_QUALIFIED::_M_fill_insert(), FillTest::filln1(), and valarray< _Tp >::operator=().

◆ find()

template<class _InputIter , class _Tp >
_InputIter find ( _InputIter  __first,
_InputIter  __last,
const _Tp &  __val 
)

Definition at line 221 of file _algobase.c.

221 {
222 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
223 return _STLP_PRIV __find(__first, __last, __val, _STLP_ITERATOR_CATEGORY(__first, _InputIter));
224}
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _RandomAccessIter __find(_RandomAccessIter __first, _RandomAccessIter __last, const _Tp &__val, const random_access_iterator_tag &)
Definition: _algobase.c:112

◆ find_end()

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

Definition at line 434 of file _algobase.c.

436 {
437 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
438 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
439 return _STLP_PRIV __find_end(__first1, __last1, __first2, __last2,
441 _STLP_ITERATOR_CATEGORY(__first1, _ForwardIter1),
442 _STLP_ITERATOR_CATEGORY(__first2, _ForwardIter2),
443#else
446#endif
447 __comp);
448}
_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_CLASS_PARTIAL_SPECIALIZATION
Definition: features.h:120

◆ find_if()

template<class _InputIter , class _Predicate >
_InputIter find_if ( _InputIter  __first,
_InputIter  __last,
_Predicate  __pred 
)

Definition at line 214 of file _algobase.c.

215 {
216 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
217 return _STLP_PRIV __find_if(__first, __last, __pred, _STLP_ITERATOR_CATEGORY(__first, _InputIter));
218}
_STLP_INLINE_LOOP _InputIter _Predicate __pred
Definition: _algo.h:68
_STLP_INLINE_LOOP _RandomAccessIter __find_if(_RandomAccessIter __first, _RandomAccessIter __last, _Predicate __pred, const random_access_iterator_tag &)
Definition: _algobase.c:159

Referenced by __write_floatT(), BcomposTest::bcompos1(), BcomposTest::bcompos2(), ctype_byname< wchar_t >::do_scan_is(), ctype_byname< wchar_t >::do_scan_not(), MemFunPtrTest::find(), FindTest::findif0(), FindTest::findif1(), _Not_within_traits< _Traits >::operator()(), _Scan_for_char_val< _Traits >::operator()(), Ptr2Test::ptrun1(), Ptr2Test::ptrun2(), remove_if(), UnaryTest::unegate1(), UnaryTest::unegate2(), and UnaryTest::unegate3().

◆ for()

for ( ;__first !  = __last;++__first)

Definition at line 71 of file _algo.h.

71 {
72 if (__pred(*__first))
73 ++__n;
74 }
return __n
Definition: _algo.h:75

◆ iter_swap()

template<class _ForwardIter1 , class _ForwardIter2 >
_STLP_MOVE_TO_STD_NAMESPACE void iter_swap ( _ForwardIter1  __i1,
_ForwardIter2  __i2 
)
inline

Definition at line 120 of file _algobase.h.

120 {
121 _STLP_PRIV __iter_swap_aux( __i1, __i2, _IsOKToSwap(_STLP_VALUE_TYPE(__i1, _ForwardIter1), _STLP_VALUE_TYPE(__i2, _ForwardIter2),
122 _STLP_IS_REF_TYPE_REAL_REF(__i1, _ForwardIter1),
123 _STLP_IS_REF_TYPE_REAL_REF(__i2, _ForwardIter2))._Answer());
124}
void __iter_swap_aux(_ForwardIter1 &__i1, _ForwardIter2 &__i2, const __true_type &)
Definition: _algobase.h:107
#define _STLP_IS_REF_TYPE_REAL_REF(_It, _Tp)
_OKToSwap< _Tp1, _Tp2, _IsRef1, _IsRef2 > _IsOKToSwap(_Tp1 *, _Tp2 *, const _IsRef1 &, const _IsRef2 &)
Definition: type_traits.h:497

Referenced by __merge_without_buffer(), __next_permutation(), __partition(), __prev_permutation(), __unguarded_partition(), IterTest::iterswp0(), IterTest::iterswp1(), IterTest::iterswp2(), IterTest::iterswp3(), random_shuffle(), and swap_ranges().

◆ lexicographical_compare() [1/3]

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

Definition at line 39 of file _algobase.c.

40 {
41 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
42 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
43 for ( ; __first1 != __last1 && __first2 != __last2
44 ; ++__first1, ++__first2) {
45 if (*__first1 < *__first2) {
46 _STLP_VERBOSE_ASSERT(!(*__first2 < *__first1), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
47 return true;
48 }
49 if (*__first2 < *__first1)
50 return false;
51 }
52 return __first1 == __last1 && __first2 != __last2;
53}

Referenced by LexcmpTest::lexcmp1(), LexcmpTest::lexcmp2(), and operator<().

◆ lexicographical_compare() [2/3]

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

Definition at line 56 of file _algobase.c.

58 {
59 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
60 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
61 for ( ; __first1 != __last1 && __first2 != __last2
62 ; ++__first1, ++__first2) {
63 if (__comp(*__first1, *__first2)) {
64 _STLP_VERBOSE_ASSERT(!__comp(*__first2, *__first1),
65 _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
66 return true;
67 }
68 if (__comp(*__first2, *__first1))
69 return false;
70 }
71 return __first1 == __last1 && __first2 != __last2;
72}

◆ lexicographical_compare() [3/3]

bool lexicographical_compare ( const unsigned char __first1,
const unsigned char __last1,
const unsigned char __first2,
const unsigned char __last2 
)
inline

Definition at line 587 of file _algobase.h.

590 {
591 const size_t __len1 = __last1 - __first1;
592 const size_t __len2 = __last2 - __first2;
593 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
594 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
595
596 const int __result = memcmp(__first1, __first2, (min) (__len1, __len2));
597 return __result != 0 ? (__result < 0) : (__len1 < __len2);
598}

◆ lexicographical_compare_3way()

template<class _InputIter1 , class _InputIter2 >
_STLP_MOVE_TO_STD_NAMESPACE int lexicographical_compare_3way ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_InputIter2  __last2 
)

Definition at line 101 of file _algobase.c.

102 {
103 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
104 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
105 return _STLP_PRIV __lexicographical_compare_3way(__first1, __last1, __first2, __last2);
106}
_STLP_MOVE_TO_PRIV_NAMESPACE int __lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2)
Definition: _algobase.c:78

◆ max() [1/2]

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

Definition at line 141 of file _algobase.h.

141{ return __a < __b ? __b : __a; }

◆ max() [2/2]

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

Definition at line 157 of file _algobase.h.

157 {
158 return __comp(__a, __b) ? __b : __a;
159}

◆ min() [1/2]

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

Definition at line 139 of file _algobase.h.

139{ return __b < __a ? __b : __a; }

◆ min() [2/2]

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

Definition at line 152 of file _algobase.h.

152 {
153 return __comp(__b, __a) ? __b : __a;
154}

◆ mismatch() [1/2]

template<class _InputIter1 , class _InputIter2 >
_STLP_INLINE_LOOP _STLP_STD::pair< _InputIter1, _InputIter2 > mismatch ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2 
)

Definition at line 522 of file _algobase.h.

524 {
525 _STLP_FIX_LITERAL_BUG(__first2)
526 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
527 while (__first1 != __last1 && *__first1 == *__first2) {
528 ++__first1;
529 ++__first2;
530 }
531 return _STLP_STD::pair<_InputIter1, _InputIter2>(__first1, __first2);
532}

Referenced by adns__findrr_anychk(), LoadRegTypeLib(), MismatchTest::mismatch0(), MismatchTest::mismatch1(), MismatchTest::mismatch2(), and tinyxml2::XMLNode::ParseDeep().

◆ mismatch() [2/2]

template<class _InputIter1 , class _InputIter2 , class _BinaryPredicate >
_STLP_INLINE_LOOP _STLP_STD::pair< _InputIter1, _InputIter2 > mismatch ( _InputIter1  __first1,
_InputIter1  __last1,
_InputIter2  __first2,
_BinaryPredicate  __binary_pred 
)

Definition at line 536 of file _algobase.h.

539 {
540 _STLP_FIX_LITERAL_BUG(__first2)
541 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
542 while (__first1 != __last1 && __binary_pred(*__first1, *__first2)) {
543 ++__first1;
544 ++__first2;
545 }
546 return _STLP_STD::pair<_InputIter1, _InputIter2>(__first1, __first2);
547}

◆ replace()

template<class _ForwardIter , class _Tp >
_STLP_INLINE_LOOP void replace ( _ForwardIter  __first,
_ForwardIter  __last,
const _Tp &  __old_value,
const _Tp &  __new_value 
)

Definition at line 701 of file _algobase.h.

702 {
703 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
704 for ( ; __first != __last; ++__first)
705 if (*__first == __old_value)
706 *__first = __new_value;
707}

◆ search()

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

Definition at line 227 of file _algobase.c.

229 {
230 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
231 _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
232 // Test for empty ranges
233 if (__first1 == __last1 || __first2 == __last2)
234 return __first1;
235
236 // Test for a pattern of length 1.
237 _ForwardIter2 __p1(__first2);
238
239 if ( ++__p1 == __last2 ) {
240 while (__first1 != __last1 && !__pred(*__first1, *__first2)) {
241 ++__first1;
242 }
243 return __first1;
244 }
245
246 // General case.
247
248 for ( ; ; ) { // __first1 != __last1 will be checked below
249 while (__first1 != __last1 && !__pred(*__first1, *__first2)) {
250 ++__first1;
251 }
252 if (__first1 == __last1) {
253 return __last1;
254 }
255 _ForwardIter2 __p = __p1;
256 _ForwardIter1 __current = __first1;
257 if (++__current == __last1) return __last1;
258
259 while (__pred(*__current, *__p)) {
260 if (++__p == __last2)
261 return __first1;
262 if (++__current == __last1)
263 return __last1;
264 }
265 ++__first1;
266 }
267 return __first1;
268}

◆ swap()

template<class _Tp >
_STLP_BEGIN_NAMESPACE void swap ( _Tp &  __a,
_Tp &  __b 
)
inline

Definition at line 81 of file _algobase.h.

81 {
82#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
83# if !defined(__BORLANDC__)
84 typedef typename _SwapImplemented<_Tp>::_Ret _Implemented;
85# else
86 enum { _Is = _SwapImplemented<_Tp>::_Is };
87 typedef typename __bool2type<_Is>::_Ret _Implemented;
88# endif
89 _STLP_PRIV __swap_aux(__a, __b, _Implemented());
90#else
91 _Tp __tmp = __a;
92 __a = __b;
93 __b = __tmp;
94#endif
95}

Variable Documentation

◆ __last

◆ __n

return __n

Definition at line 662 of file _algobase.h.

Referenced by __copy(), __copy_backward(), __copy_trivial(), __fill(), __fill_n(), and fill_n().

◆ __val

_STLP_INLINE_LOOP _InputIter const _Tp& __val
Initial value:
{
_STLP_DIFFERENCE_TYPE(_InputIter) __n = 0
#define _STLP_DIFFERENCE_TYPE(_Iterator)

Definition at line 656 of file _algobase.h.

Referenced by __adjacent_difference(), __adjust_heap(), __BVECTOR_QUALIFIED::__BVECTOR(), __do_get_float(), __do_get_integer(), __equal_range(), __fill(), __fill_fwd(), __fill_n(), __find(), __get_decimal_integer(), __get_integer(), __get_num(), __iota(), __linear_insert(), __lower_bound(), __partial_sum(), __pop_heap(), __push_heap(), __search_n(), __uinit_aux(), __uinit_aux_aux(), __unguarded_linear_insert(), __uninitialized_init(), __unique_copy(), __upper_bound(), _Base_bitset< _Nw >::_Base_bitset(), _CArray< _Tp, _Nb >::_CArray(), _Copy_Construct(), _Copy_Construct_aux(), _logb(), _Sanitize< _Extrabits >::_M_do_sanitize(), deque< _Tp, >::_M_fill_assign(), slist< _Tp, >::_M_fill_assign(), vector< _Tp, >::_M_fill_assign(), list< _Tp, >::_M_fill_assign(), deque< _Tp, >::_M_fill_initialize(), hashtable< _Val, _Key, _HF, _Traits, _ExK, _EqK, _All >::_M_get_key(), vector< _Tp, >::_M_initialize(), deque< _Tp, >::_M_initialize(), _Rb_tree< _Key, _Compare, _Value, _KeyOfValue, _Traits, >::_M_insert(), _Move_Construct(), _Move_Construct_Aux(), _Param_Construct(), _Param_Construct_aux(), bitset< _Nb >::_Unchecked_set(), deque< _Tp, >::assign(), slist< _Tp, >::assign(), vector< _Tp, >::assign(), list< _Tp, >::assign(), binary_search(), constant0(), constant1(), constant2(), construct(), pthread_allocator< _Tp >::construct(), per_thread_allocator< _Tp >::construct(), EH_allocator< _Tp >::construct(), allocator< _Tp >::construct(), StackAllocator< _Tp >::construct(), count(), num_get< _CharT, _InputIter >::do_get(), num_put< _CharT, _OutputIter >::do_put(), equal_range(), fill(), fill_n(), find(), num_get< _CharT, _InputIter >::get(), _Rb_tree< _Key, _Compare, _Value, _KeyOfValue, _Traits, >::insert_equal(), _Rb_tree< _Key, _Compare, _Value, _KeyOfValue, _Traits, >::insert_unique(), iota(), lower_bound(), unordered_map< _Key, _Tp,,, >::max_load_factor(), unordered_multimap< _Key, _Tp,,, >::max_load_factor(), unordered_set< _Value,,, >::max_load_factor(), unordered_multiset< _Value,,, >::max_load_factor(), _Rb_tree< key_type, key_compare, value_type, _STLP_SELECT1ST(value_type, int), _MapTraits, _Alloc >::operator=(), ostream_iterator< _TpP, _CharT, _Traits >::operator=(), back_insert_iterator< _Container >::operator=(), front_insert_iterator< _Container >::operator=(), insert_iterator< _Container >::operator=(), basic_istream< _CharT, _Traits >::operator>>(), num_put< _CharT, _OutputIter >::put(), remove(), slist< _Tp, >::remove(), list< _Tp, >::remove(), remove_copy(), search_n(), bitset< _Nb >::set(), test_signed_integral_limits(), test_unsigned_integral_limits(), uninitialized_fill(), and upper_bound().