43 #ifndef PSTORE_ADT_POINTER_BASED_ITERATOR_HPP 44 #define PSTORE_ADT_POINTER_BASED_ITERATOR_HPP 48 #include <type_traits> 56 using difference_type = std::ptrdiff_t;
57 using pointer = value_type *;
58 using reference = value_type &;
59 using iterator_category = std::random_access_iterator_tag;
61 template <
typename Other,
typename =
typename std::enable_if_t<
62 std::is_const<T>::value && !std::is_const<Other>::value>>
66 template <typename Other, typename = typename std::enable_if_t<std::is_const<T>::value ==
67 std::is_const<Other>::value>>
71 template <
typename Other>
73 return pos_ == &*other;
75 template <
typename Other>
77 return pos_ != &*other;
80 template <
typename Other>
87 constexpr value_type * operator-> () noexcept {
return pos_; }
88 constexpr value_type
const * operator-> ()
const noexcept {
return pos_; }
89 constexpr value_type & operator* () noexcept {
return *pos_; }
90 constexpr value_type
const & operator* ()
const noexcept {
return *pos_; }
92 constexpr value_type & operator[] (std::size_t
const n) noexcept {
return *(pos_ + n); }
93 constexpr value_type
const & operator[] (std::size_t
const n)
const noexcept {
102 auto const prev = *
this;
111 auto const prev = *
this;
125 template <
typename Other>
126 constexpr
bool operator< (pointer_based_iterator<Other>
const & other)
const noexcept {
127 return pos_ < &*other;
129 template <
typename Other>
131 return pos_ > &*other;
133 template <
typename Other>
134 constexpr
bool operator<= (pointer_based_iterator<Other>
const & other)
const noexcept {
135 return pos_ <= &*other;
137 template <
typename Other>
139 return pos_ >= &*other;
150 template <
typename T>
153 typename pointer_based_iterator<T>::difference_type
const n) noexcept {
161 template <
typename T>
163 operator+ (
typename pointer_based_iterator<T>::difference_type
const n,
173 template <
typename T>
176 typename pointer_based_iterator<T>::difference_type
const n) noexcept {
181 template <
typename T>
182 inline typename pointer_based_iterator<T>::difference_type
189 #endif // PSTORE_ADT_POINTER_BASED_ITERATOR_HPP Definition: pointer_based_iterator.hpp:53
Definition: nonpod2.cpp:40