FastLED 3.9.15
Loading...
Searching...
No Matches

◆ value()

template<typename T>
const T & fl::task::Promise< T >::value ( ) const
inline

Get the result value (only valid if is_resolved() returns true)

Definition at line 158 of file promise.h.

158 {
159 if (!valid()) {
160 static const T default_value{};
161 return default_value;
162 }
163 return mImpl->value();
164 }
fl::shared_ptr< detail::PromiseImpl< T > > mImpl
Shared pointer to implementation - this allows copying and sharing Promise state.
Definition promise.h:209
bool valid() const FL_NOEXCEPT
Check if Promise is valid.
Definition promise.h:108
Promise class that provides fluent .then() and .catch_() semantics This is a lightweight wrapper arou...
Definition promise.h:58

References FL_NOEXCEPT, mImpl, and valid().

Referenced by fl::task::await_top_level(), complete_with_value(), complete_with_value(), resolve(), and resolve().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: