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/latest/classgoogle_1_1cloud_1_1future below:

Class future<T> (2.42.0-rc) | C++ Client Libraries

Class future<T> (2.42.0-rc)

Stay organized with collections Save and categorize content based on your preferences.

Implement ISO/IEC TS 19571:2016 future<T>.

Constructors future() future(future< future< T > > &&)

Creates a new future that unwraps rhs.

This constructor creates a new shared state that becomes satisfied when both rhs and rhs.get() become satisfied. If rhs is satisfied, but rhs.get() returns an invalid future then the newly created future becomes satisfied with a std::future_error exception, and the exception error code is std::future_errc::broken_promise.

Note: The technical specification requires this to be a noexcept constructor I (coryan) believe this is a defect in the technical specification, as this creates a new shared state: shared states are dynamically allocated, and the allocator (which might be the default operator new) may raise. Parameter Name Description rhs future< future< T > > &&
future(future< U > &&)

Creates a future from a future whose result type is convertible to this future's result type.

Parameters Name Description rhs future< U > &&
class U
typename Enable
future(std::shared_ptr< shared_state_type >) Parameter Name Description state std::shared_ptr< shared_state_type >
Functions get()

Waits until the shared state becomes ready, then retrieves the value stored in the shared state.

Note: This operation invalidates the future, subsequent calls will fail, the application should capture the returned value because it would.

Exceptions Type Description ... any exceptions stored in the shared state. std::future_error with std::no_state if the future does not have a shared state. Returns Type Description T then(F &&)

Attach a continuation to the future.

Attach a callable func to be invoked when the future is ready. The return type is a future wrapping the return type of func.

Side effects: valid() == false if the operation is successful.

Parameters Name Description func F &&

a Callable to be invoked when the future is ready. The function might be called immediately, e.g., if the future is ready.

typename F
Returns Type Description future< >

future<T> where T is std::result_of_t<F, R> (basically). If T matches future<U> then it returns future<U>. The returned future will contain the result of func.

Type Aliases shared_state_type

Alias Of: typename internal::future_base< T >::shared_state_type

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 latest version of the `future` class documentation is 2.37.0-rc, and the page provides links to the documentation for versions dating back to 2.10.1."],["The `future` class implements ISO/IEC TS 19571:2016 `future\u003cT\u003e`, which includes constructors for creating and unwrapping futures, as well as converting result types."],["The `get()` function waits for the shared state to be ready and then retrieves the stored value, invalidating the future for subsequent calls, and it can throw exceptions if it does not have a shared state or has stored exceptions."],["The `then(F &&)` function attaches a continuation function to the future, which is invoked when the future is ready, and it returns a new future containing the result of the provided function."],["The type alias `shared_state_type` is aliased to `typename internal::future_base\u003c T \u003e::shared_state_type`."]]],[]]


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