template <typename Soa, size_t... Columns>
soagen::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

iterator() constexpr noexcept
Default constructor.
iterator(const iterator&) defaulted
Copy constructor.
iterator(soa_ref src, difference_type pos) constexpr noexcept
Constructs an iterator to some row of a SoA container.

Public functions

auto operator=(const iterator&) →  iterator& defaulted
Copy-assignment operator.

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

template <typename Soa, size_t... Columns>
template <typename T, size_t... Cols>
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:

FromToexplicitNote
T&const T&gains const
T&&T&&&&
T&&const T&&&&, gains const
T&&const T&&gains const
const T&&const T&&&&
T&T&&YesEquivalent to std::move()
T&const T&&YesEquivalent to std::move()
const T&const T&&YesEquivalent to std::move()