ReactOS 0.4.15-dev-7670-g69b08be
_iterator.h File Reference
#include <stl/_pair.h>
#include <stl/_alloc.h>
Include dependency graph for _iterator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _DBG_iter_base< _Container >
 
struct  _DBG_iter_mid< _Container, _Traits >
 
struct  _DBG_iter< _Container, _Traits >
 
class  __construct_checker< _Container >
 

Functions

template<class _Iterator >
_STLP_BEGIN_NAMESPACE _STLP_MOVE_TO_PRIV_NAMESPACE void _Decrement (_Iterator &__it, const bidirectional_iterator_tag &)
 
template<class _Iterator >
void _Decrement (_Iterator &__it, const random_access_iterator_tag &)
 
template<class _Iterator >
void _Decrement (_Iterator &__it, const forward_iterator_tag &)
 
template<class _Iterator >
void _Advance (_Iterator &, ptrdiff_t, const forward_iterator_tag &)
 
template<class _Iterator >
void _Advance (_Iterator &__it, ptrdiff_t, const bidirectional_iterator_tag &)
 
template<class _Iterator >
void _Advance (_Iterator &__it, ptrdiff_t __n, const random_access_iterator_tag &)
 
template<class _Iterator >
ptrdiff_t _DBG_distance (const _Iterator &__x, const _Iterator &__y, const random_access_iterator_tag &)
 
template<class _Iterator >
ptrdiff_t _DBG_distance (const _Iterator &, const _Iterator &, const forward_iterator_tag &)
 
template<class _Iterator >
ptrdiff_t _DBG_distance (const _Iterator &, const _Iterator &, const bidirectional_iterator_tag &)
 
template<class _Iterator >
bool _CompareIt (const _Iterator &, const _Iterator &, const forward_iterator_tag &)
 
template<class _Iterator >
bool _CompareIt (const _Iterator &, const _Iterator &, const bidirectional_iterator_tag &)
 
template<class _Iterator >
bool _CompareIt (const _Iterator &__x, const _Iterator &__y, const random_access_iterator_tag &)
 
template<class _Iterator >
bool _Dereferenceable (const _Iterator &__it)
 
template<class _Iterator >
bool _Incrementable (const _Iterator &__it, ptrdiff_t __n, const forward_iterator_tag &)
 
template<class _Iterator >
bool _Incrementable (const _Iterator &__it, ptrdiff_t __n, const bidirectional_iterator_tag &)
 
template<class _Iterator >
bool _Incrementable (const _Iterator &__it, ptrdiff_t __n, const random_access_iterator_tag &)
 
template<class _Container >
ptrdiff_t operator- (const _DBG_iter_base< _Container > &__x, const _DBG_iter_base< _Container > &__y)
 
template<class _Container >
bool operator== (const _DBG_iter_base< _Container > &__x, const _DBG_iter_base< _Container > &__y)
 
template<class _Container >
bool operator< (const _DBG_iter_base< _Container > &__x, const _DBG_iter_base< _Container > &__y)
 
template<class _Container >
bool operator> (const _DBG_iter_base< _Container > &__x, const _DBG_iter_base< _Container > &__y)
 
template<class _Container >
bool operator>= (const _DBG_iter_base< _Container > &__x, const _DBG_iter_base< _Container > &__y)
 
template<class _Container >
bool operator<= (const _DBG_iter_base< _Container > &__x, const _DBG_iter_base< _Container > &__y)
 
template<class _Container >
bool operator!= (const _DBG_iter_base< _Container > &__x, const _DBG_iter_base< _Container > &__y)
 
template<class _Container , class _Traits >
_DBG_iter< _Container, _Traits > operator+ (ptrdiff_t __n, const _DBG_iter< _Container, _Traits > &__it)
 
template<class _Iterator >
_Iterator _Non_Dbg_iter (_Iterator __it)
 

Function Documentation

◆ _Advance() [1/3]

template<class _Iterator >
void _Advance ( _Iterator &  ,
ptrdiff_t  ,
const forward_iterator_tag  
)

Definition at line 49 of file _iterator.h.

50{ _STLP_ASSERT(0) }
#define _STLP_ASSERT(expr)
Definition: _debug.h:165

Referenced by _DBG_iter_base< _Container >::__advance().

◆ _Advance() [2/3]

template<class _Iterator >
void _Advance ( _Iterator &  __it,
ptrdiff_t  __n,
const random_access_iterator_tag  
)

Definition at line 57 of file _iterator.h.

58{ __it += __n; }
return __n
Definition: _algo.h:75
_STLP_MOVE_TO_PRIV_NAMESPACE const _InputIterator const input_iterator_tag &_InputIterator __it(__first)

◆ _Advance() [3/3]

template<class _Iterator >
void _Advance ( _Iterator &  __it,
ptrdiff_t  ,
const bidirectional_iterator_tag  
)

Definition at line 53 of file _iterator.h.

54{ _STLP_ASSERT(0) }

◆ _CompareIt() [1/3]

template<class _Iterator >
bool _CompareIt ( const _Iterator &  ,
const _Iterator &  ,
const bidirectional_iterator_tag  
)

Definition at line 83 of file _iterator.h.

83 {
86}
return
Definition: dirsup.c:529
#define false
Definition: stdbool.h:37

◆ _CompareIt() [2/3]

template<class _Iterator >
bool _CompareIt ( const _Iterator &  ,
const _Iterator &  ,
const forward_iterator_tag  
)

Definition at line 77 of file _iterator.h.

77 {
80}

Referenced by operator<(), operator<=(), operator>(), and operator>=().

◆ _CompareIt() [3/3]

template<class _Iterator >
bool _CompareIt ( const _Iterator &  __x,
const _Iterator &  __y,
const random_access_iterator_tag  
)

Definition at line 89 of file _iterator.h.

90{ return __x < __y; }

◆ _DBG_distance() [1/3]

template<class _Iterator >
ptrdiff_t _DBG_distance ( const _Iterator &  ,
const _Iterator &  ,
const bidirectional_iterator_tag  
)

Definition at line 71 of file _iterator.h.

71 {
73 return 0;
74}

◆ _DBG_distance() [2/3]

template<class _Iterator >
ptrdiff_t _DBG_distance ( const _Iterator &  ,
const _Iterator &  ,
const forward_iterator_tag  
)

Definition at line 65 of file _iterator.h.

65 {
67 return 0;
68}

◆ _DBG_distance() [3/3]

template<class _Iterator >
ptrdiff_t _DBG_distance ( const _Iterator &  __x,
const _Iterator &  __y,
const random_access_iterator_tag  
)

Definition at line 61 of file _iterator.h.

62{ return __x - __y; }

Referenced by operator-().

◆ _Decrement() [1/3]

template<class _Iterator >
_STLP_BEGIN_NAMESPACE _STLP_MOVE_TO_PRIV_NAMESPACE void _Decrement ( _Iterator &  __it,
const bidirectional_iterator_tag  
)

Definition at line 37 of file _iterator.h.

38{ --__it; }

Referenced by _DBG_iter_base< _Container >::__decrement().

◆ _Decrement() [2/3]

template<class _Iterator >
void _Decrement ( _Iterator &  __it,
const forward_iterator_tag  
)

Definition at line 45 of file _iterator.h.

46{ _STLP_ASSERT(0) }

◆ _Decrement() [3/3]

template<class _Iterator >
void _Decrement ( _Iterator &  __it,
const random_access_iterator_tag  
)

Definition at line 41 of file _iterator.h.

42{ --__it; }

◆ _Dereferenceable()

◆ _Incrementable() [1/3]

template<class _Iterator >
bool _Incrementable ( const _Iterator &  __it,
ptrdiff_t  __n,
const bidirectional_iterator_tag  
)

Definition at line 101 of file _iterator.h.

101 {
102 typedef typename _Iterator::_Container_type __container_type;
103 __container_type* __c = __it._Get_container_ptr();
104 return (__c != 0) && ((__n == 1 && __it._M_iterator != __c->end() ) ||
105 (__n == -1 && __it._M_iterator != __c->begin()));
106}
#define __c
Definition: schilyio.h:209

◆ _Incrementable() [2/3]

template<class _Iterator >
bool _Incrementable ( const _Iterator &  __it,
ptrdiff_t  __n,
const forward_iterator_tag  
)

Definition at line 97 of file _iterator.h.

98{ return (__n == 1) && _Dereferenceable(__it); }
bool _Dereferenceable(const _Iterator &__it)
Definition: _iterator.h:93

Referenced by _DBG_iter_base< _Container >::__advance(), _DBG_iter_base< _Container >::__decrement(), and _DBG_iter_base< _Container >::__increment().

◆ _Incrementable() [3/3]

template<class _Iterator >
bool _Incrementable ( const _Iterator &  __it,
ptrdiff_t  __n,
const random_access_iterator_tag  
)

Definition at line 109 of file _iterator.h.

109 {
110 typedef typename _Iterator::_Container_type __container_type;
111 __container_type* __c = __it._Get_container_ptr();
112 if (__c == 0) return false;
113 ptrdiff_t __new_pos = (__it._M_iterator - __c->begin()) + __n;
114 return (__new_pos >= 0) && (__STATIC_CAST(typename __container_type::size_type, __new_pos) <= __c->size());
115}
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247
#define __STATIC_CAST(__x, __y)
Definition: features.h:585

◆ _Non_Dbg_iter()

template<class _Iterator >
_Iterator _Non_Dbg_iter ( _Iterator  __it)
inline

◆ operator!=()

template<class _Container >
bool operator!= ( const _DBG_iter_base< _Container > &  __x,
const _DBG_iter_base< _Container > &  __y 
)
inline

Definition at line 345 of file _iterator.h.

346 {
347 _STLP_DEBUG_CHECK(__check_same_or_null_owner(__x, __y))
348 return __x._M_iterator != __y._M_iterator;
349}
#define _STLP_DEBUG_CHECK(expr)
Definition: _debug.h:440
_Nonconst_iterator _M_iterator
Definition: _iterator.h:153

◆ operator+()

template<class _Container , class _Traits >
_DBG_iter< _Container, _Traits > operator+ ( ptrdiff_t  __n,
const _DBG_iter< _Container, _Traits > &  __it 
)
inline

Definition at line 355 of file _iterator.h.

355 {
357 return __tmp += __n;
358}

◆ operator-()

template<class _Container >
ptrdiff_t operator- ( const _DBG_iter_base< _Container > &  __x,
const _DBG_iter_base< _Container > &  __y 
)

Definition at line 175 of file _iterator.h.

176 {
177 typedef typename _DBG_iter_base<_Container>::_Iterator_category _Iterator_category;
178 _STLP_DEBUG_CHECK(__check_same_owner(__x, __y))
179 return _DBG_distance(__x._M_iterator,__y._M_iterator, _Iterator_category());
180}
ptrdiff_t _DBG_distance(const _Iterator &__x, const _Iterator &__y, const random_access_iterator_tag &)
Definition: _iterator.h:61
_Container::_Iterator_category _Iterator_category
Definition: _iterator.h:133

◆ operator<()

template<class _Container >
bool operator< ( const _DBG_iter_base< _Container > &  __x,
const _DBG_iter_base< _Container > &  __y 
)
inline

Definition at line 312 of file _iterator.h.

313 {
314 _STLP_DEBUG_CHECK(__check_same_or_null_owner(__x, __y))
315 typedef typename _DBG_iter_base<_Container>::_Iterator_category _Category;
316 return _CompareIt(__x._M_iterator , __y._M_iterator, _Category());
317}
bool _CompareIt(const _Iterator &, const _Iterator &, const forward_iterator_tag &)
Definition: _iterator.h:77

◆ operator<=()

template<class _Container >
bool operator<= ( const _DBG_iter_base< _Container > &  __x,
const _DBG_iter_base< _Container > &  __y 
)
inline

Definition at line 336 of file _iterator.h.

338 {
339 typedef typename _DBG_iter_base<_Container>::_Iterator_category _Category;
340 return !_CompareIt(__y._M_iterator , __x._M_iterator, _Category());
341}

◆ operator==()

template<class _Container >
bool operator== ( const _DBG_iter_base< _Container > &  __x,
const _DBG_iter_base< _Container > &  __y 
)
inline

Definition at line 306 of file _iterator.h.

306 {
307 _STLP_DEBUG_CHECK(__check_same_or_null_owner(__x, __y))
308 return __x._M_iterator == __y._M_iterator;
309}

◆ operator>()

template<class _Container >
bool operator> ( const _DBG_iter_base< _Container > &  __x,
const _DBG_iter_base< _Container > &  __y 
)
inline

Definition at line 321 of file _iterator.h.

322 {
323 typedef typename _DBG_iter_base<_Container>::_Iterator_category _Category;
324 return _CompareIt(__y._M_iterator , __x._M_iterator, _Category());
325}

◆ operator>=()

template<class _Container >
bool operator>= ( const _DBG_iter_base< _Container > &  __x,
const _DBG_iter_base< _Container > &  __y 
)
inline

Definition at line 329 of file _iterator.h.

329 {
330 _STLP_DEBUG_CHECK(__check_same_or_null_owner(__x, __y))
331 typedef typename _DBG_iter_base<_Container>::_Iterator_category _Category;
332 return !_CompareIt(__x._M_iterator , __y._M_iterator, _Category());
333}