Lumiera  0.pre.03
»edit your freedom«
AddressExposingIter< IT > Class Template Reference

#include "lib/iter-adapter-ptr-deref.hpp"

Description

template<class IT>
class lib::AddressExposingIter< IT >

wrapper for an existing Iterator type to expose the address of each value yielded.

Typically this can be used to build visitation sequences based on values living within a stable data structure (e.g. unmodifiable STL vector)

Warning
use of this wrapper might lead to taking the address of temporaries. The continued existence of the exposed storage locations must be guaranteed.
Note
bool checkable if and only if source is...

Definition at line 221 of file iter-adapter-ptr-deref.hpp.

Public Types

typedef IT::pointer const * pointer
 
typedef IT::pointer const & reference
 
typedef IT::pointer const value_type
 

Public Member Functions

 AddressExposingIter (IT srcIter)
 AddressExposingIter is always created by wrapping an existing iterator.
 
bool empty () const
 
 ENABLE_USE_IN_STD_RANGE_FOR_LOOPS (AddressExposingIter)
 
IT const & getBase () const
 access the wrapped implementation iterator
 
bool isValid () const
 
 operator bool () const
 
reference operator* () const
 
AddressExposingIteroperator++ ()
 
_Ptr operator-> () const
 

Private Types

typedef IT::pointer _Ptr
 

Private Member Functions

void takeAddress ()
 

Private Attributes

_Ptr currPtr_
 
IT i_
 nested source iterator
 

Member Function Documentation

◆ operator*()

reference operator* ( ) const
inline
Returns
address of the source iteraor's current result
Warning
exposing a reference to an internal pointer for sake of compatibility. Clients must not store that reference, but rather use it to initialise a copy. The internal pointer exposed here will be changed on increment.

Definition at line 275 of file iter-adapter-ptr-deref.hpp.

References PtrDerefIter< IT >::i_.

+ Collaboration diagram for AddressExposingIter< IT >:

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