table: operator[] overloads
This commit is contained in:
@@ -356,6 +356,20 @@ public:
|
||||
return {std::get<container_for<Row>>(payload).rend()...};
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the row data at specified location.
|
||||
* @param pos The row for which to return the data.
|
||||
* @return The row data at specified location.
|
||||
*/
|
||||
[[nodiscard]] std::tuple<const Row &...> operator[](const size_type pos) const {
|
||||
return std::forward_as_tuple(std::get<container_for<Row>>(payload)[pos]...);
|
||||
}
|
||||
|
||||
/*! @copydoc operator[] */
|
||||
[[nodiscard]] std::tuple<Row &...> operator[](const size_type pos) {
|
||||
return std::forward_as_tuple(std::get<container_for<Row>>(payload)[pos]...);
|
||||
}
|
||||
|
||||
/*! @brief Clears a table. */
|
||||
void clear() {
|
||||
(std::get<container_for<Row>>(payload).clear(), ...);
|
||||
|
||||
Reference in New Issue
Block a user