template <typename Soa, size_t... Columns>
iterator class
RandomAccessIterator for SoA types.
Public types
-
using difference_type = std::
ptrdiff_t - Signed integer difference type used by the corresponding SoA type.
-
using iterator_category = std::
random_access_iterator_tag - This iterator type is a RandomAccessIterator.
-
using reference = row_
type - Alias for row_
type. -
using row_type = soagen::
row_type<Soa, Columns...> - The soagen::
row type dereferenced by this iterator. -
using size_type = std::
size_t - Unsigned integer size type used by the corresponding SoA type.
-
using soa_ref = coerce_
ref<Soa> - Cvref-qualified version of soa_
type. -
using soa_type = remove_
cvref<Soa> - Base SoA type for this iterator.
-
using value_type = row_
type - Alias for row_
type.
Constructors, destructors, conversion operators
Public functions
Comparison
-
template <typename T, size_t... Cols>auto operator<(const iterator<T, Cols...>& rhs) const → bool constexpr noexcept
- Returns true if the LHS iterator refers to a row less-than the RHS iterator.
-
template <typename T, size_t... Cols>auto operator<=(const iterator<T, Cols...>& rhs) const → bool constexpr noexcept
- Returns true if the LHS iterator refers to a row less-than-or-equal-to the RHS iterator.
-
template <typename T, size_t... Cols>auto operator>(const iterator<T, Cols...>& rhs) const → bool constexpr noexcept
- Returns true if the LHS iterator refers to a row greater-than the RHS iterator.
-
template <typename T, size_t... Cols>auto operator>=(const iterator<T, Cols...>& rhs) const → bool constexpr noexcept
- Returns true if the LHS iterator refers to a row greater-than-or-equal-to the RHS iterator.
Conversion
- operator difference_type() const explicit constexpr noexcept
- Converts this iterator to it's underlying difference_
type value. -
template <typename T, size_t... Cols>operator iterator<T, Cols...>() const constexpr noexcept
- Converts between different iterators for the same SoA type.
Decrementing
-
auto operator-(const iterator& it,
difference_
type n) → iterator constexpr noexcept - Returns a copy of an iterator decremented by some arbitrary number of rows.
- auto operator--(iterator& it) → iterator& constexpr noexcept
- Decrements the iterator by one row (pre-fix).
- auto operator--(iterator& it, int) → iterator constexpr noexcept
- Decrements the iterator by one row (post-fix).
-
auto operator-=(iterator& it,
difference_
type n) → iterator& constexpr noexcept - Decrements the iterator by some arbitrary number of rows.
Dereferencing
- auto operator*() const → reference constexpr noexcept
- Returns the row the iterator refers to.
-
auto operator->() const → detail::arrow_proxy<row_
type> constexpr noexcept - Returns the row the iterator refers to.
-
auto operator[](difference_
type offset) const → reference constexpr noexcept - Returns the row at some arbitrary offset from the one the iterator refers to.
Difference
-
template <typename T, size_t... Cols>auto operator-(const iterator<T, Cols...>& rhs) const → difference_
type constexpr noexcept - Returns the difference between two iterators.
Equality
-
template <typename T, size_t... Cols>auto operator==(const iterator<T, Cols...>& rhs) const → bool constexpr noexcept
- Returns true if two iterators refer to the same row in the same SoA container.
-
template <typename T, size_t... Cols>auto operator!=(const iterator& lhs, const iterator<T, Cols...>& rhs) → bool constexpr noexcept
- Returns true if two iterators do not refer to the same row in the same SoA container.
Incrementing
-
auto operator+(const iterator& it,
difference_
type n) → iterator constexpr noexcept - Returns a copy of an iterator incremented by some arbitrary number of rows.
- auto operator++(iterator& it) → iterator& constexpr noexcept
- Increments the iterator by one row (pre-fix).
- auto operator++(iterator& it, int) → iterator constexpr noexcept
- Increments the iterator by one row (post-fix).
-
auto operator+=(iterator& it,
difference_
type n) → iterator& constexpr noexcept - Increments the iterator by some arbitrary number of rows.
Function documentation
soagen::iterator::operator iterator<T, Cols...>() const constexpr noexcept
Converts between different iterators for the same SoA type.
This operator allows the following conversions, only some of which are implicit:
From | To | explicit | Note |
---|---|---|---|
T& | const T& | gains const | |
T&& | T& | && →
& | |
T&& | const T& | && →
& , gains const | |
T&& | const T&& | gains const | |
const T&& | const T& | && →
& | |
T& | T&& | Yes | Equivalent to std::move() |
T& | const T&& | Yes | Equivalent to std::move() |
const T& | const T&& | Yes | Equivalent to std::move() |