Callers can iterate the range using its begin() and end() members to access iterators that will work with any normal C++ constructs and algorithms that accept Input Iterators.
Callers should only consume/iterate this range.
Example: Iterating a range of 10 integers
// Some function that returns a StreamRange<int>
StreamRange<int> MakeRangeFromOneTo(int n);
StreamRange<int> sr = MakeRangeFromOneTo(10);
for (StatusOr<int> const& x : sr) {
if (!x) {
std::cerr << "Fail: " << x.status() << "\n";
} else {
std::cout << *x << "\n";
}
}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-19 UTC."],[],[]]