CppCommon  1.0.4.1
C++ Common Library
Public Types | Public Member Functions | Friends | List of all members
CppCommon::ListIterator< T > Class Template Reference

Intrusive list iterator. More...

#include <list.h>

Public Types

typedef T value_type
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef ptrdiff_t difference_type
 
typedef size_t size_type
 
typedef std::bidirectional_iterator_tag iterator_category
 

Public Member Functions

 ListIterator () noexcept
 
 ListIterator (T *node) noexcept
 
 ListIterator (const ListIterator &it) noexcept=default
 
 ListIterator (ListIterator &&it) noexcept=default
 
 ~ListIterator () noexcept=default
 
ListIteratoroperator= (const ListIterator &it) noexcept=default
 
ListIteratoroperator= (ListIterator &&it) noexcept=default
 
ListIteratoroperator++ () noexcept
 
ListIterator operator++ (int) noexcept
 
reference operator* () noexcept
 
pointer operator-> () noexcept
 
 operator bool () const noexcept
 Check if the iterator is valid. More...
 
void swap (ListIterator &it) noexcept
 Swap two instances. More...
 

Friends

bool operator== (const ListIterator &it1, const ListIterator &it2) noexcept
 
bool operator!= (const ListIterator &it1, const ListIterator &it2) noexcept
 
template<typename U >
void swap (ListIterator< U > &it1, ListIterator< U > &it2) noexcept
 

Detailed Description

template<typename T>
class CppCommon::ListIterator< T >

Intrusive list iterator.

Not thread-safe.

Definition at line 298 of file list.h.

Member Typedef Documentation

◆ const_pointer

template<typename T >
typedef const value_type* CppCommon::ListIterator< T >::const_pointer

Definition at line 308 of file list.h.

◆ const_reference

template<typename T >
typedef const value_type& CppCommon::ListIterator< T >::const_reference

Definition at line 306 of file list.h.

◆ difference_type

template<typename T >
typedef ptrdiff_t CppCommon::ListIterator< T >::difference_type

Definition at line 309 of file list.h.

◆ iterator_category

template<typename T >
typedef std::bidirectional_iterator_tag CppCommon::ListIterator< T >::iterator_category

Definition at line 311 of file list.h.

◆ pointer

template<typename T >
typedef value_type* CppCommon::ListIterator< T >::pointer

Definition at line 307 of file list.h.

◆ reference

template<typename T >
typedef value_type& CppCommon::ListIterator< T >::reference

Definition at line 305 of file list.h.

◆ size_type

template<typename T >
typedef size_t CppCommon::ListIterator< T >::size_type

Definition at line 310 of file list.h.

◆ value_type

template<typename T >
typedef T CppCommon::ListIterator< T >::value_type

Definition at line 304 of file list.h.

Constructor & Destructor Documentation

◆ ListIterator() [1/4]

template<typename T >
CppCommon::ListIterator< T >::ListIterator ( )
inlinenoexcept

Definition at line 313 of file list.h.

◆ ListIterator() [2/4]

template<typename T >
CppCommon::ListIterator< T >::ListIterator ( T *  node)
inlineexplicitnoexcept

Definition at line 314 of file list.h.

◆ ListIterator() [3/4]

template<typename T >
CppCommon::ListIterator< T >::ListIterator ( const ListIterator< T > &  it)
defaultnoexcept

◆ ListIterator() [4/4]

template<typename T >
CppCommon::ListIterator< T >::ListIterator ( ListIterator< T > &&  it)
defaultnoexcept

◆ ~ListIterator()

template<typename T >
CppCommon::ListIterator< T >::~ListIterator ( )
defaultnoexcept

Member Function Documentation

◆ operator bool()

template<typename T >
CppCommon::ListIterator< T >::operator bool ( ) const
inlineexplicitnoexcept

Check if the iterator is valid.

Definition at line 334 of file list.h.

◆ operator*()

template<typename T >
ListIterator< T >::reference CppCommon::ListIterator< T >::operator*
noexcept

Definition at line 292 of file list.inl.

◆ operator++() [1/2]

template<typename T >
ListIterator< T > & CppCommon::ListIterator< T >::operator++
noexcept

Definition at line 276 of file list.inl.

◆ operator++() [2/2]

template<typename T >
ListIterator< T > CppCommon::ListIterator< T >::operator++ ( int  )
inlinenoexcept

Definition at line 284 of file list.inl.

◆ operator->()

template<typename T >
ListIterator< T >::pointer CppCommon::ListIterator< T >::operator->
noexcept

Definition at line 300 of file list.inl.

◆ operator=() [1/2]

template<typename T >
ListIterator& CppCommon::ListIterator< T >::operator= ( const ListIterator< T > &  it)
defaultnoexcept

◆ operator=() [2/2]

template<typename T >
ListIterator& CppCommon::ListIterator< T >::operator= ( ListIterator< T > &&  it)
defaultnoexcept

◆ swap()

template<typename T >
void CppCommon::ListIterator< T >::swap ( ListIterator< T > &  it)
noexcept

Swap two instances.

Definition at line 306 of file list.inl.

Friends And Related Function Documentation

◆ operator!=

template<typename T >
bool operator!= ( const ListIterator< T > &  it1,
const ListIterator< T > &  it2 
)
friend

Definition at line 324 of file list.h.

◆ operator==

template<typename T >
bool operator== ( const ListIterator< T > &  it1,
const ListIterator< T > &  it2 
)
friend

Definition at line 322 of file list.h.

◆ swap

template<typename T >
template<typename U >
void swap ( ListIterator< U > &  it1,
ListIterator< U > &  it2 
)
friend

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