45 #ifndef LIB_ITER_ADAPTER_PTR_DEREF_H 46 #define LIB_ITER_ADAPTER_PTR_DEREF_H 51 #include <type_traits> 72 using pointer =
typename meta::ValueTypeBinding<IT>::value_type;
73 static_assert(std::is_pointer_v<pointer>);
75 using value_type =
typename std::remove_pointer_t<pointer>;
76 using reference = value_type&;
84 using ValueTypeBase =
typename std::remove_const_t<value_type>;
118 : i_(reinterpret_cast<IT const&> (oIter.
getBase()))
124 i_ =
reinterpret_cast<IT const&
> (ref.
getBase());
129 operator bool()
const 145 return PtrDerefIter (reinterpret_cast<IT const&> (srcIter));
189 return not isValid();
203 template<
class I1,
class I2>
206 template<
class I1,
class I2>
232 typedef typename IT::pointer _Ptr;
236 mutable _Ptr currPtr_;
250 typedef typename IT::pointer
const*
pointer;
251 typedef typename IT::pointer
const& reference;
252 typedef typename IT::pointer
const value_type;
268 operator bool()
const 312 return not isValid();
326 template<
class I1,
class I2>
329 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.