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

Intrusive stack iterator. More...

#include <stack.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::forward_iterator_tag iterator_category
 

Public Member Functions

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

Friends

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

Detailed Description

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

Intrusive stack iterator.

Not thread-safe.

Definition at line 192 of file stack.h.

Member Typedef Documentation

◆ const_pointer

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

Definition at line 202 of file stack.h.

◆ const_reference

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

Definition at line 200 of file stack.h.

◆ difference_type

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

Definition at line 203 of file stack.h.

◆ iterator_category

template<typename T >
typedef std::forward_iterator_tag CppCommon::StackIterator< T >::iterator_category

Definition at line 205 of file stack.h.

◆ pointer

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

Definition at line 201 of file stack.h.

◆ reference

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

Definition at line 199 of file stack.h.

◆ size_type

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

Definition at line 204 of file stack.h.

◆ value_type

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

Definition at line 198 of file stack.h.

Constructor & Destructor Documentation

◆ StackIterator() [1/4]

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

Definition at line 207 of file stack.h.

◆ StackIterator() [2/4]

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

Definition at line 208 of file stack.h.

◆ StackIterator() [3/4]

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

◆ StackIterator() [4/4]

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

◆ ~StackIterator()

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

Member Function Documentation

◆ operator bool()

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

Check if the iterator is valid.

Definition at line 228 of file stack.h.

◆ operator*()

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

Definition at line 131 of file stack.inl.

◆ operator++() [1/2]

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

Definition at line 115 of file stack.inl.

◆ operator++() [2/2]

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

Definition at line 123 of file stack.inl.

◆ operator->()

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

Definition at line 139 of file stack.inl.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ swap()

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

Swap two instances.

Definition at line 145 of file stack.inl.

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 218 of file stack.h.

◆ operator==

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

Definition at line 216 of file stack.h.

◆ swap

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

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