| Home | Libraries | People | FAQ | More

#### rows

An owning, read-only sequence of rows.

##### Synopsis

Defined in header `<boost/mysql/rows.hpp>`

    class rows;

##### 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
--- | ---
at | Returns the i-th row or throws an exception.
back | Returns the last row.
begin | Returns an iterator to the first element in the collection.
empty | Returns true if there are no rows in the collection (i.e. `this->size() == 0`)
end | Returns an iterator to one-past-the-last element in the collection.
front | Returns the first row.
num_columns | Returns the number of elements each row in the collection has.
operator rows_view | Creates a `rows_view` that references `*this`.
operator= | Copy assignment. — Move assignment. — Replaces the contents of `*this` with a `rows_view`.
operator[] | Returns the i-th row (unchecked access).
rows [constructor] | Construct an empty `rows` object. — Copy constructor. — Move constructor. — Constructs a rows object from a `rows_view`.
size | Returns the number of rows in the collection.
~rows [destructor] | Destructor.

##### Related Non-member Functions

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

##### Description

Models an owning, matrix-like container. Indexing a `rows` object (by using iterators, `rows::at` or `rows::operator[]`) returns a `row_view` object, representing a single row. All rows in the collection are the same size (as given by `num_columns`).

A `rows` object owns a chunk of memory in which it stores its elements. The `rows_view` objects obtained on element access point into the `rows`' internal storage. These views (and any `row_view` and `field_view` obtained from the former) behave like references, and are valid as long as pointers, iterators and references into the `rows` object remain valid.

Although owning, `rows` is read-only. It's optimized for memory re-use.

Convenience header `<boost/mysql.hpp>`