Class StreamRange<T> (2.46.0-rc) Stay organized with collections Save and categorize content based on your preferences.
AStreamRange<T> is a range ofStatusOr<T> where the end-of-stream is indicated by a non-OKStatus.
Callers can iterate the range using itsbegin() andend() members to access iterators that will work with any normal C++ constructs and algorithms that acceptInput 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"; }}StreamRange<T> for testing (e.g. to mock aConnection::ListFoo call), seegoogle::cloud::mocks::MakeStreamRange.Constructors
StreamRange(StreamRange const &)
Move-only
| Parameter | |
|---|---|
| Name | Description |
| StreamRange const & |
StreamRange(StreamRange &&)
Move-only
| Parameter | |
|---|---|
| Name | Description |
| StreamRange && |
StreamRange()
Default-constructs an empty range.
Operators
operator=(StreamRange const &)
Move-only
| Parameter | |
|---|---|
| Name | Description |
| StreamRange const & |
| Returns | |
|---|---|
| Type | Description |
StreamRange & | |
operator=(StreamRange &&)
Move-only
| Parameter | |
|---|---|
| Name | Description |
| StreamRange && |
| Returns | |
|---|---|
| Type | Description |
StreamRange & | |
Functions
begin()
| Returns | |
|---|---|
| Type | Description |
iterator | |
end()
| Returns | |
|---|---|
| Type | Description |
iterator | |
Type Aliases
value_type
Alias Of:
StatusOr< T >iterator
Alias Of:
IteratorImpl< value_type >difference_type
Alias Of:
typename iterator::difference_typereference
Alias Of:
typename iterator::referencepointer
Alias Of:
typename iterator::pointerconst_reference
Alias Of:
typename iterator::const_referenceconst_pointer
Alias Of:
typename iterator::const_pointerExcept as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-17 UTC.