1 #ifndef MATIOCPP_VECTORITERATOR_H
2 #define MATIOCPP_VECTORITERATOR_H
35 template <
class Vector,
bool IsConst>
39 using input_vector_type = std::conditional_t<IsConst, const Vector, Vector>;
47 using reference = std::conditional_t<IsConst, const element_type_, element_type_>&;
48 using pointer = std::add_pointer_t<reference>;
57 template<
bool B, std::enable_if_t<!B && IsConst>* =
nullptr>
138 return lhs.vector_ == rhs.vector_ && lhs.index_ == rhs.index_;
144 return !(lhs == rhs);
150 return lhs.index_ < rhs.index_;
176 template <
class Span,
bool IsConst>
184 template <
class Span,
bool IsConst>
#define MATIOCPP_CONSTEXPR
size_t index_type
Defines how to allocate T.
typename get_type< T >::type element_type
Defines the type specified in the template.
MATIOCPP_CONSTEXPR vector_iterator & operator+=(difference_type n)
MATIOCPP_CONSTEXPR vector_iterator operator++(int)
vector_iterator()=default
MATIOCPP_CONSTEXPR friend bool operator>(vector_iterator lhs, vector_iterator rhs) noexcept
MATIOCPP_CONSTEXPR friend bool operator>=(vector_iterator lhs, vector_iterator rhs) noexcept
MATIOCPP_CONSTEXPR vector_iterator(input_vector_type *vector, typename Vector::index_type idx) noexcept
std::add_pointer_t< reference > pointer
MATIOCPP_CONSTEXPR vector_iterator operator-(difference_type n) const
MATIOCPP_CONSTEXPR vector_iterator & operator-=(difference_type n)
MATIOCPP_CONSTEXPR friend bool operator==(vector_iterator lhs, vector_iterator rhs) noexcept
MATIOCPP_CONSTEXPR vector_iterator(const vector_iterator< Vector, B > &other) noexcept
MATIOCPP_CONSTEXPR difference_type operator-(vector_iterator rhs) const
input_vector_type * vector_
MATIOCPP_CONSTEXPR friend bool operator<(vector_iterator lhs, vector_iterator rhs) noexcept
typename Vector::index_type difference_type
MATIOCPP_CONSTEXPR vector_iterator operator--(int)
MATIOCPP_CONSTEXPR reference operator*() const
MATIOCPP_CONSTEXPR pointer operator->() const
MATIOCPP_CONSTEXPR vector_iterator & operator++()
MATIOCPP_CONSTEXPR reference operator[](difference_type n) const
std::conditional_t< IsConst, const element_type_, element_type_ > & reference
MATIOCPP_CONSTEXPR vector_iterator & operator--()
MATIOCPP_CONSTEXPR friend bool operator!=(vector_iterator lhs, vector_iterator rhs) noexcept
MATIOCPP_CONSTEXPR vector_iterator operator+(difference_type n) const
MATIOCPP_CONSTEXPR friend bool operator<=(vector_iterator lhs, vector_iterator rhs) noexcept
std::remove_cv_t< element_type_ > value_type
MATIOCPP_CONSTEXPR vector_iterator< Span, IsConst > operator+(typename vector_iterator< Span, IsConst >::difference_type n, vector_iterator< Span, IsConst > rhs)
MATIOCPP_CONSTEXPR vector_iterator< Span, IsConst > operator-(typename vector_iterator< Span, IsConst >::difference_type n, vector_iterator< Span, IsConst > rhs)