pabigot  0.1.1
C++ support classes
Public Member Functions
pabigot::container::forward_chain< T, REF_NEXT >::chain_iterator_type Class Reference

Iterator type designed to support range-for. More...

#include </mnt/devel/pabigot-cxx/include/pabigot/container.hpp>

Public Member Functions

bool operator== (const end_iterator_type &)
 Return true iff this iterator is past the end of its chain.
 
bool operator!= (const end_iterator_type &rhs)
 Minimum operator required for range-for support. More...
 
chain_iterator_typeoperator++ ()
 Increment to reference the cached successor of the current.
 
value_typeoperator* () noexcept
 Get a reference to the value in the chain. More...
 

Detailed Description

template<typename T, typename REF_NEXT>
class pabigot::container::forward_chain< T, REF_NEXT >::chain_iterator_type

Iterator type designed to support range-for.

An iterator can be dereferenced to produce a reference to a value within the chain. The reference is not const-qualified.

An iterator can be pre-incremented, which will update it so that when dereferenced it will reference the value that was the successor of the value referenced by the iterator at the time the iterator was last updated.

I.e., if you have an iterator that references e, and f follows e in the chain, then removing e from the chain and incrementing the iterator will reference f.

Member Function Documentation

◆ operator!=()

template<typename T , typename REF_NEXT >
bool pabigot::container::forward_chain< T, REF_NEXT >::chain_iterator_type::operator!= ( const end_iterator_type rhs)
inline

Minimum operator required for range-for support.

Returns false iff this iterator is past the end of its chain.

◆ operator*()

template<typename T , typename REF_NEXT >
value_type& pabigot::container::forward_chain< T, REF_NEXT >::chain_iterator_type::operator* ( )
inlinenoexcept

Get a reference to the value in the chain.

Warning
Invoking this in a situation where iter != end() is false will dereference a null pointer.

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