77# include <type_traits>
99# define STL_ITOR_SPEC(It_Name) \
102 using T = typename Set_Type::Item_Type; \
103 using Itor = typename Set_Type::Iterator; \
107 Itor operator ++ () \
113 Itor operator ++ (int) \
115 Itor ret_val = *this; \
120 bool operator == (const Itor & it) const noexcept \
122 if (this->has_curr() and it.has_curr()) \
123 return this->get_pos() == it.get_pos(); \
125 if (not this->has_curr() and not it.has_curr()) \
131 bool operator != (const Itor & it) const noexcept \
133 return not (*this == it); \
147 template <
class Set_Type>
159 return &
const_cast<T &
>(this->
get_curr());
182 template <
class Set_Type>
191 return const_cast<T *
>(&this->
get_curr());
208# define STL_ALEPH_ITERATOR(Set_Name) \
209 using iterator = __iterator<Set_Name>; \
211 using const_iterator = __const_iterator<Set_Name>; \
213 iterator begin() noexcept { return iterator::begin(*this); } \
215 iterator end() noexcept { return iterator::end(*this); } \
217 const_iterator begin() const noexcept \
219 return const_iterator::cbegin(*this); \
222 const_iterator end() const noexcept \
224 return const_iterator::cend(*this); \
227 const_iterator cbegin() const noexcept \
229 return const_iterator::cbegin(*this); \
232 const_iterator cend() const noexcept \
234 return const_iterator::cend(*this); \
237 const_iterator cbegin() noexcept \
239 return const_iterator::cbegin(*this); \
242 const_iterator cend() noexcept \
244 return const_iterator::cend(*this); \
247 friend const_iterator cbegin(const Set_Name & s) noexcept \
248 { return s.begin(); } \
250 friend const_iterator cend(const Set_Name & s) noexcept \
251 { return s.end(); } \
253 friend const_iterator begin(const Set_Name & s) noexcept \
254 { return s.begin(); } \
256 friend const_iterator end(const Set_Name & s) noexcept \
257 { return s.end(); } \
259 friend iterator begin(Set_Name & s) noexcept { return s.begin(); } \
261 friend iterator end(Set_Name & s) noexcept { return s.end(); }
264 inline template <
class Itor>
#define STL_ITOR_SPEC(It_Name)
Main namespace for Aleph-w library functions.
auto get_curr() const
Return the current tuple (bounds-checked).
DynList< T > maps(const C &c, Op op)
Classic map operation.
STL-compatible const iterator wrapper.
static __const_iterator cend(const Set_Type &s) noexcept
typename Set_Type::Item_Type T
static __const_iterator cbegin(const Set_Type &s) noexcept
T const * operator->() const noexcept
const T & operator*() const noexcept
STL-compatible mutable iterator wrapper.
typename Set_Type::Item_Type T
static __iterator begin(const Set_Type &s) noexcept
static __iterator end(const Set_Type &s) noexcept
Iterator traits for Aleph-w iterators.
Itor::value_type value_type
Element type.
Itor::difference_type difference_type
Distance type.
Itor::reference reference
Reference to element.
Itor::pointer pointer
Pointer to element.