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.

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 <auto Member>
decltype(auto) soagen::row::get() const constexpr noexcept

Returns a reference to the specified member's value.