A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/cpp/docs/reference/common/2.31.0/classgoogle_1_1cloud_1_1StreamRange.html below:

Class StreamRange<T> (2.31.0) | C++ Client Libraries

Class StreamRange<T> (2.31.0)

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";
  }
}
Note: To construct a StreamRange<T> for testing (e.g. to mock a Connection::ListFoo call), see google::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_type

reference

Alias Of: typename iterator::reference

pointer

Alias Of: typename iterator::pointer

const_reference

Alias Of: typename iterator::const_reference

const_pointer

Alias Of: typename iterator::const_pointer

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 `StreamRange\u003cT\u003e` class represents a range of `StatusOr\u003cT\u003e` objects, signaling the end of the stream with a non-OK `Status`."],["This range can be iterated using its `begin()` and `end()` members, compatible with C++ Input Iterators and algorithms."],["`StreamRange` is a move-only class, which means it can be moved but not copied."],["`StreamRange` includes several Type Aliases, such as `value_type` (aliased to `StatusOr\u003cT\u003e`) and `iterator` (aliased to `IteratorImpl\u003cvalue_type\u003e`), to clarify its internal structure."],["For testing purposes, you can use `google::cloud::mocks::MakeStreamRange` to create a `StreamRange\u003cT\u003e`."]]],[]]


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