| Home | Libraries | People | FAQ | More

##### rows_view::const_reference

The reference type.

###### Synopsis

    using const_reference = row_view;

###### Types

Name | Description
--- | ---
const_iterator | A random access iterator to an element.
const_reference | The reference type.
difference_type | A signed integer type used to represent differences.
iterator | A random access iterator to an element.
reference | The reference type.
size_type | An unsigned integer type to represent sizes.
value_type | A type that can hold elements in this collection with value semantics.

###### Member Functions

Name | Description
--- | ---
as_vector | Converts the row into a `std::vector` of `field`'s. — Converts the row into a `std::vector` of `field`'s.
at | Returns the i-th element in the row or throws an exception.
back | Returns the last element in the row.
begin | Returns an iterator to the first field in the row.
empty | Returns true if there are no fields in the row (i.e. `this->size() == 0`).
end | Returns an iterator to one-past-the-last field in the row.
front | Returns the first element in the row.
operator[] | Returns the i-th element in the row (unchecked access).
row_view | Constructs an empty (but valid) view.
size | Returns the number of fields in the row.

###### Related Functions

Name | Description
--- | ---
operator== | Equality operator.
operator!= | Inequality operator.

A `row_view` points to memory owned by an external entity (like `string_view` does). The validity of a `row_view` depends on how it was obtained:

- If it was constructed from a `row` object (by calling `row::operator row_view()`), the view acts as a reference to the row's allocated memory, and is valid as long as references to that row elements are valid.
- If it was obtained by indexing a `rows` object, the same applies.
- If it was obtained by indexing a `rows_view` object, it's valid as long as the `rows_view` is valid.

Calling any member function on an invalid view results in undefined behavior.

When indexed (by using iterators, `row_view::at` or `row_view::operator[]`), it returns `field_view` elements that are valid as long as the underlying storage that `*this` points to is valid. Destroying a `row_view` doesn't invalidate `field_view`s obtained from it.

Instances of this class are usually created by the library, not by the user.