STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | List of all members
_List_const_iterator< _Mylist > Class Template Reference
Inheritance diagram for _List_const_iterator< _Mylist >:
_List_unchecked_const_iterator< _Mylist, _Iterator_base > _Iterator012< bidirectional_iterator_tag, _Mylist::value_type, _Mylist::difference_type, _Mylist::const_pointer, _Mylist::const_reference, _Iterator_base > _Iterator_base0 _List_iterator< _Mylist >

Public Types

typedef _List_const_iterator< _Mylist > _Myiter
 
typedef _List_unchecked_const_iterator< _Mylist, _Iterator_base_Mybase
 
typedef bidirectional_iterator_tag iterator_category
 
typedef _Mylist::_Nodeptr _Nodeptr
 
typedef _Mylist::value_type value_type
 
typedef _Mylist::difference_type difference_type
 
typedef _Mylist::const_pointer pointer
 
typedef _Mylist::const_reference reference
 
typedef _List_unchecked_const_iterator< _Mylist > _Unchecked_type
 
- Public Types inherited from _List_unchecked_const_iterator< _Mylist, _Iterator_base >
typedef _List_unchecked_const_iterator< _Mylist, _Iterator_base_Myiter
 
typedef bidirectional_iterator_tag iterator_category
 
typedef _Mylist::_Nodeptr _Nodeptr
 
typedef _Mylist::value_type value_type
 
typedef _Mylist::difference_type difference_type
 
typedef _Mylist::const_pointer pointer
 
typedef _Mylist::const_reference reference
 
- Public Types inherited from _Iterator012< bidirectional_iterator_tag, _Mylist::value_type, _Mylist::difference_type, _Mylist::const_pointer, _Mylist::const_reference, _Iterator_base >
typedef bidirectional_iterator_tag iterator_category
 
typedef _Mylist::value_type value_type
 
typedef _Mylist::difference_type difference_type
 
typedef _Mylist::const_pointer pointer
 
typedef _Mylist::const_reference reference
 

Public Member Functions

 _List_const_iterator ()
 
 _List_const_iterator (_Nodeptr _Pnode, const _Mylist *_Plist)
 
_Myiter_Rechecked (_Unchecked_type _Right)
 
_Unchecked_type _Unchecked () const
 
reference operator* () const
 
_Myiteroperator++ ()
 
_Myiter operator++ (int)
 
_Myiteroperator-- ()
 
_Myiter operator-- (int)
 
bool operator== (const _Myiter &_Right) const
 
bool operator!= (const _Myiter &_Right) const
 
- Public Member Functions inherited from _List_unchecked_const_iterator< _Mylist, _Iterator_base >
 _List_unchecked_const_iterator ()
 
 _List_unchecked_const_iterator (_Nodeptr _Pnode, const _Mylist *_Plist)
 
reference operator* () const
 
pointer operator-> () const
 
_Myiteroperator++ ()
 
_Myiter operator++ (int)
 
_Myiteroperator-- ()
 
_Myiter operator-- (int)
 
bool operator== (const _Myiter &_Right) const
 
bool operator!= (const _Myiter &_Right) const
 
_Nodeptr _Mynode () const
 
- Public Member Functions inherited from _Iterator_base0
void _Adopt (const void *)
 
const _Container_base0_Getcont () const
 

Additional Inherited Members

- Public Attributes inherited from _List_unchecked_const_iterator< _Mylist, _Iterator_base >
_Nodeptr _Ptr
 

Member Typedef Documentation

template<class _Mylist>
typedef _List_unchecked_const_iterator<_Mylist, _Iterator_base> _List_const_iterator< _Mylist >::_Mybase
template<class _Mylist>
typedef _List_const_iterator<_Mylist> _List_const_iterator< _Mylist >::_Myiter
template<class _Mylist>
typedef _Mylist::_Nodeptr _List_const_iterator< _Mylist >::_Nodeptr
template<class _Mylist>
typedef _List_unchecked_const_iterator<_Mylist> _List_const_iterator< _Mylist >::_Unchecked_type
template<class _Mylist>
typedef _Mylist::difference_type _List_const_iterator< _Mylist >::difference_type
template<class _Mylist>
typedef bidirectional_iterator_tag _List_const_iterator< _Mylist >::iterator_category
template<class _Mylist>
typedef _Mylist::const_pointer _List_const_iterator< _Mylist >::pointer
template<class _Mylist>
typedef _Mylist::const_reference _List_const_iterator< _Mylist >::reference
template<class _Mylist>
typedef _Mylist::value_type _List_const_iterator< _Mylist >::value_type

Constructor & Destructor Documentation

template<class _Mylist>
_List_const_iterator< _Mylist >::_List_const_iterator ( )
inline
181  : _Mybase()
182  { // construct with null node pointer
183  }
_List_unchecked_const_iterator< _Mylist, _Iterator_base > _Mybase
Definition: list:171
template<class _Mylist>
_List_const_iterator< _Mylist >::_List_const_iterator ( _Nodeptr  _Pnode,
const _Mylist *  _Plist 
)
inline
186  : _Mybase(_Pnode, _Plist)
187  { // construct with node pointer _Pnode
188  }
_List_unchecked_const_iterator< _Mylist, _Iterator_base > _Mybase
Definition: list:171

Member Function Documentation

template<class _Mylist>
_Myiter& _List_const_iterator< _Mylist >::_Rechecked ( _Unchecked_type  _Right)
inline
193  { // reset from unchecked iterator
194  this->_Ptr = _Right._Ptr;
195  return (*this);
196  }
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Mylist>
_Unchecked_type _List_const_iterator< _Mylist >::_Unchecked ( ) const
inline
199  { // make an unchecked iterator
200  return (_Unchecked_type(this->_Ptr, static_cast<const _Mylist *>(this->_Getcont())));
201  }
_List_unchecked_const_iterator< _Mylist > _Unchecked_type
Definition: list:190
const _Container_base0 * _Getcont() const
Definition: xutility:57
template<class _Mylist>
bool _List_const_iterator< _Mylist >::operator!= ( const _Myiter _Right) const
inline
305  { // test for iterator inequality
306  return (!(*this == _Right));
307  }
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Mylist>
reference _List_const_iterator< _Mylist >::operator* ( ) const
inline
204  { // return designated value
205  #if _ITERATOR_DEBUG_LEVEL == 2
206  const auto _Mycont = static_cast<const _Mylist *>(this->_Getcont());
207  if (_Mycont == 0
208  || this->_Ptr == nullptr_t{}
209  || this->_Ptr == _Mycont->_Myhead)
210  { // report error
211  _DEBUG_ERROR("list iterator not dereferencable");
213  }
214 
215  #elif _ITERATOR_DEBUG_LEVEL == 1
216  _SCL_SECURE_VALIDATE(this->_Ptr != nullptr_t{});
217  const auto _Mycont = static_cast<const _Mylist *>(this->_Getcont());
218  _SCL_SECURE_VALIDATE(_Mycont != 0);
219  _SCL_SECURE_VALIDATE_RANGE(this->_Ptr != _Mycont->_Myhead);
220  #endif /* _ITERATOR_DEBUG_LEVEL */
221 
222  return (_Mylist::_Myval(this->_Ptr));
223  }
const _Container_base0 * _Getcont() const
Definition: xutility:57
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:396
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:391
template<class _Mylist>
_Myiter& _List_const_iterator< _Mylist >::operator++ ( )
inline
226  { // preincrement
227  #if _ITERATOR_DEBUG_LEVEL == 2
228  const auto _Mycont = static_cast<const _Mylist *>(this->_Getcont());
229  if (_Mycont == 0
230  || this->_Ptr == nullptr_t{}
231  || this->_Ptr == _Mycont->_Myhead)
232  { // report error
233  _DEBUG_ERROR("list iterator not incrementable");
235  }
236 
237  #elif _ITERATOR_DEBUG_LEVEL == 1
238  _SCL_SECURE_VALIDATE(this->_Ptr != nullptr_t{});
239  const auto _Mycont = static_cast<const _Mylist *>(this->_Getcont());
240  _SCL_SECURE_VALIDATE(_Mycont != 0);
241  _SCL_SECURE_VALIDATE_RANGE(this->_Ptr != _Mycont->_Myhead);
242  #endif /* _ITERATOR_DEBUG_LEVEL */
243 
244  this->_Ptr = _Mylist::_Nextnode(this->_Ptr);
245  return (*this);
246  }
const _Container_base0 * _Getcont() const
Definition: xutility:57
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:396
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:391
template<class _Mylist>
_Myiter _List_const_iterator< _Mylist >::operator++ ( int  )
inline
249  { // postincrement
250  _Myiter _Tmp = *this;
251  ++*this;
252  return (_Tmp);
253  }
_List_const_iterator< _Mylist > _Myiter
Definition: list:170
template<class _Mylist>
_Myiter& _List_const_iterator< _Mylist >::operator-- ( )
inline
256  { // predecrement
257  #if _ITERATOR_DEBUG_LEVEL == 2
258  const auto _Mycont = static_cast<const _Mylist *>(this->_Getcont());
259  if (_Mycont == 0
260  || this->_Ptr == nullptr_t{}
261  || (this->_Ptr = _Mylist::_Prevnode(this->_Ptr)) == _Mycont->_Myhead)
262  { // report error
263  _DEBUG_ERROR("list iterator not decrementable");
265  }
266 
267  #elif _ITERATOR_DEBUG_LEVEL == 1
268  _SCL_SECURE_VALIDATE(this->_Ptr != nullptr_t{});
269  const auto _Mycont = static_cast<const _Mylist *>(this->_Getcont());
270  _SCL_SECURE_VALIDATE(_Mycont != 0);
271  this->_Ptr = _Mylist::_Prevnode(this->_Ptr);
272  _SCL_SECURE_VALIDATE_RANGE(this->_Ptr != _Mycont->_Myhead);
273 
274  #else /* _ITERATOR_DEBUG_LEVEL */
275  this->_Ptr = _Mylist::_Prevnode(this->_Ptr);
276  #endif /* _ITERATOR_DEBUG_LEVEL */
277 
278  return (*this);
279  }
const _Container_base0 * _Getcont() const
Definition: xutility:57
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:396
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:391
template<class _Mylist>
_Myiter _List_const_iterator< _Mylist >::operator-- ( int  )
inline
282  { // postdecrement
283  _Myiter _Tmp = *this;
284  --*this;
285  return (_Tmp);
286  }
_List_const_iterator< _Mylist > _Myiter
Definition: list:170
template<class _Mylist>
bool _List_const_iterator< _Mylist >::operator== ( const _Myiter _Right) const
inline
289  { // test for iterator equality
290  #if _ITERATOR_DEBUG_LEVEL == 2
291  if (this->_Getcont() != _Right._Getcont())
292  { // report error
293  _DEBUG_ERROR("list iterators incompatible");
295  }
296 
297  #elif _ITERATOR_DEBUG_LEVEL == 1
298  _SCL_SECURE_VALIDATE(this->_Getcont() == _Right._Getcont());
299  #endif /* _ITERATOR_DEBUG_LEVEL */
300 
301  return (this->_Ptr == _Right._Ptr);
302  }
const _Container_base0 * _Getcont() const
Definition: xutility:57
#define _SCL_SECURE_INVALID_ARGUMENT
Definition: yvals.h:395
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
constexpr const _Ty &() _Right
Definition: algorithm:3591
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:391

The documentation for this class was generated from the following file: