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-08-22 UTC."],[[["\u003cp\u003eThis page documents various versions of the \u003ccode\u003eTupleStream\u003c/code\u003e class, specifically within the Google Cloud Spanner C++ library, with the latest being version 2.37.0-rc.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTupleStream\u003c/code\u003e is a class that defines a range for parsing \u003ccode\u003eTuple\u003c/code\u003e objects from a given range of \u003ccode\u003eRowStreamIterator\u003c/code\u003es.\u003c/p\u003e\n"],["\u003cp\u003eUsers typically utilize the \u003ccode\u003eStreamOf<T>(range)\u003c/code\u003e factory function to create \u003ccode\u003eTupleStream\u003c/code\u003e instances for iterating through rows, in a range-for loop.\u003c/p\u003e\n"],["\u003cp\u003eThe term "stream" within the name \u003ccode\u003eTupleStream\u003c/code\u003e refers to the nature of the data source, not to be confused with C++ I/O streams.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTupleStream\u003c/code\u003e includes an iterator type alias and \u003ccode\u003ebegin()\u003c/code\u003e and \u003ccode\u003eend()\u003c/code\u003e methods to facilitate range-based operations.\u003c/p\u003e\n"]]],[],null,[]]