36 #ifndef LIB_ITER_ADAPTER_PTR_DEREF_H 37 #define LIB_ITER_ADAPTER_PTR_DEREF_H 42 #include <type_traits> 63 using pointer =
typename meta::ValueTypeBinding<IT>::value_type;
64 static_assert(std::is_pointer_v<pointer>);
66 using value_type =
typename std::remove_pointer_t<pointer>;
67 using reference = value_type&;
75 using ValueTypeBase =
typename std::remove_const_t<value_type>;
109 : i_(reinterpret_cast<IT const&> (oIter.
getBase()))
115 i_ =
reinterpret_cast<IT const&
> (ref.
getBase());
120 operator bool()
const 136 return PtrDerefIter (reinterpret_cast<IT const&> (srcIter));
180 return not isValid();
194 template<
class I1,
class I2>
197 template<
class I1,
class I2>
223 typedef typename IT::pointer _Ptr;
227 mutable _Ptr currPtr_;
241 typedef typename IT::pointer
const*
pointer;
242 typedef typename IT::pointer
const& reference;
243 typedef typename IT::pointer
const value_type;
259 operator bool()
const 303 return not isValid();
317 template<
class I1,
class I2>
320 template<
class I1,
class I2>
wrapper for an existing Iterator type, automatically dereferencing the output of the former...
typename meta::ValueTypeBinding< IT >::value_type pointer
this iterator adapter is meant to wrap an iterator yielding pointer values
IT i_
nested source iterator
Helper template(s) for creating Lumiera Forward Iterators.
IT const & getBase() const
access the wrapped implementation iterator
bool operator==(PtrDerefIter< I1 > const &il, PtrDerefIter< I2 > const &ir)
Supporting equality comparisons...
#define ENABLE_USE_IN_STD_RANGE_FOR_LOOPS(ITER)
use a given Lumiera Forward Iterator in standard "range for loops"
Implementation namespace for support and library code.
PtrDerefIter(PtrDerefIter< WrappedIterType > const &oIter)
allow copy initialisation also when the wrapped iterator is based on some variation of a pointer...
IT const & getBase() const
access the wrapped implementation iterator
static PtrDerefIter build_by_cast(WrappedIterType const &srcIter)
explicit builder to allow creating a const variant from the basic srcIter type.
wrapper for an existing Iterator type to expose the address of each value yielded.
reference operator*() const
AddressExposingIter(IT srcIter)
AddressExposingIter is always created by wrapping an existing iterator.
IT i_
nested source iterator
auto ptrDeref(IT iter)
Convenience shortcut to dereference pointers yielded from the wrapped iterator.
PtrDerefIter(IT srcIter)
PtrDerefIter is always created by wrapping an existing iterator.