Stay organized with collections Save and categorize content based on your preferences.
A StreamRange
<T>
is a range of StatusOr
<T>
where the end-of-stream is indicated by a non-OK Status
.
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";
}
}
Constructors StreamRange Parameter Name DescriptionNote: To construct a
StreamRange
<T>
for testing (e.g. to mock aConnection::ListFoo
call), seegoogle::cloud::mocks::MakeStreamRange
.
StreamRange const &
StreamRange &&
Default-constructs an empty range.
~StreamRange Operators operator= Parameter Name Description
StreamRange const &
StreamRange &
operator= Parameter Name Description
StreamRange &&
StreamRange &
Functions begin Returns Type Description iterator
end Returns Type Description iterator
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-14 UTC.
[[["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 2025-08-14 UTC."],[[["The webpage details the `StreamRange\u003cT\u003e` class, which represents a range of `StatusOr\u003cT\u003e` values, with a non-OK `Status` indicating the end of the stream."],["Callers can iterate through the `StreamRange\u003cT\u003e` using its `begin()` and `end()` members, enabling the use of standard C++ constructs and algorithms designed for Input Iterators."],["The `StreamRange` can be utilized with many versions of the library, from 2.10.1 up to 2.37.0-rc, all of which are referenced through links."],["The class provides a default constructor to make an empty range, and move/copy assignment and constructors to duplicate existing ranges."],["The range can be used with a `for` loop to iterate through the values, and an example of using a range of integers is provided."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4