template <typename Soa, size_t... Columns>
soagen::row struct

A proxy type for treating (some subset of) an SoA row as if it were a regular AoS struct.

This type has reference semantics; In addition to the member functions described below, rows for soagen-generated SoA types will named member references variables matching their columns, e.g.:

[structs.employees]
variables = [
    {name = "id",     type = "unsigned long long"},
    {name = "name",   type = "std::string"},
    {name = "salary", type = "long long"},
]

Would correspond to:

struct soagen::row<employees>
{
    unsigned long long& id;
    std::string&        name;
    long long&          salary;
};

Alternatively, if you're not using the generator and are just using a soagen::table directly, you'll get ordinally-named reference members for columns 0-15:

                // a row for this type:
                using employees = soagen::table<unsigned long long, std::string, long long /* ... */>;
* 
*               // would look like this:
*               struct soagen::row<employees>
*               {
*                   unsigned long long& first;
*                   std::string&        second;
*                   long long&          third;
* 
*                   // ...and so on, up to "sixteenth".
*               };
*               

Columns

template <auto Column>
auto column() const -> decltype(auto) constexpr noexcept
Returns a reference to the specified column's value.
template <typename Func>
void for_each_column(Func&& func) const constexpr noexcept(…)
Invokes a callable once for each column in the row.

Comparison

template <typename T>
auto operator<(const row& lhs, const row<T, Columns...>& rhs) -> bool constexpr noexcept(…)
Returns true if the RHS row is ordered lexicographically less-than the RHS row.
template <typename T>
auto operator<=(const row& lhs, const row<T, Columns...>& rhs) -> bool constexpr noexcept(…)
Returns true if the RHS row is ordered lexicographically less-than-or-equal-to the RHS row.
template <typename T>
auto operator>(const row& lhs, const row<T, Columns...>& rhs) -> bool constexpr noexcept(…)
Returns true if the RHS row is ordered lexicographically greater-than the RHS row.
template <typename T>
auto operator>=(const row& lhs, const row<T, Columns...>& rhs) -> bool constexpr noexcept(…)
Returns true if the RHS row is ordered lexicographically greater-than-or-equal-to the RHS row.

Conversion

template <typename T, size_t... Cols>
operator row<T, Cols...>() const constexpr noexcept
Converts between different rows for the same SoA type.

Equality

template <typename T>
auto operator!=(const row& lhs, const row<T, Columns...>& rhs) -> bool constexpr noexcept(…)
Returns true if not all of the elements in two rows are equal.
template <typename T>
auto operator==(const row& lhs, const row<T, Columns...>& rhs) -> bool constexpr noexcept(…)
Returns true if all of the elements in two rows are equal.

Tuple protocol

template <auto Member>
auto get() const -> decltype(auto) constexpr noexcept
Returns a reference to the specified member's value.

Function documentation

template <typename Soa, size_t... Columns>
template <typename Func>
void soagen::row::for_each_column(Func&& func) const constexpr noexcept(…)

Invokes a callable once for each column in the row.

template <typename Soa, size_t... Columns>
template <typename T, size_t... Cols>
soagen::row::operator row<T, Cols...>() const constexpr noexcept

Converts between different rows 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()

template <typename Soa, size_t... Columns>
template <auto Member>
decltype(auto) soagen::row::get() const constexpr noexcept

Returns a reference to the specified member's value.