Users create instances using the StreamOf<T>(range) non-member factory function (defined below). The following is a typical usage of this class in a range-for loop.
auto row_range = ...
using RowType = std::tuple<std::int64_t, std::string, bool>;
for (auto const& row : StreamOf<RowType>(row_range)) {
if (!row) {
// Handle error;
}
std::int64_t x = std::get<0>(*row);
...
}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-02 UTC."],[[["This webpage provides documentation for the `TupleStream` class in the Google Cloud Spanner C++ library, covering versions from 2.11.0 up to the latest release candidate, 2.37.0-rc."],["`TupleStream` parses `Tuple` objects from a range of `RowStreamIterator`s, and is designed for use in range-based for loops."],["The `StreamOf\u003cT\u003e(range)` non-member factory function is used to create instances of the `TupleStream` class."],["The class is a \"range\" defined by two \"iterator\" objects of type `TupleStreamIterator\u003cTuple\u003e`, which are accessible through the `begin()` and `end()` functions."],["The term \"stream\" in `TupleStream` indicates the general nature of the data source, and does not relate to C++ I/O streams."]]],[]]