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::
// 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
Comparison
- auto operator<(const row& lhs, const row<T, Columns...>& rhs) → constexpr bool constexpr noexcept(…)
- Returns true if the RHS row is ordered lexicographically less-than the RHS row.
- auto operator<=(const row& lhs, const row<T, Columns...>& rhs) → constexpr bool constexpr noexcept(…)
- Returns true if the RHS row is ordered lexicographically less-than-or-equal-to the RHS row.
- auto operator>(const row& lhs, const row<T, Columns...>& rhs) → constexpr bool constexpr noexcept(…)
- Returns true if the RHS row is ordered lexicographically greater-than the RHS row.
- auto operator>=(const row& lhs, const row<T, Columns...>& rhs) → constexpr bool constexpr noexcept(…)
- Returns true if the RHS row is ordered lexicographically greater-than-or-equal-to the RHS row.
Conversion
- auto operator row<T, Cols...>() const → constexpr constexpr noexcept
- Converts between different rows for the same SoA type.
Equality
- auto operator!=(const row& lhs, const row<T, Columns...>& rhs) → constexpr bool constexpr noexcept(…)
- Returns true if not all of the elements in two rows are equal.
- auto operator==(const row& lhs, const row<T, Columns...>& rhs) → constexpr bool constexpr noexcept(…)
- Returns true if all of the elements in two rows are equal.
Tuple protocol
Function documentation
constexpr 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:
| 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() |