FastLED 3.10.8
Loading...
Searching...
No Matches

◆ value() [2/2]

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

Get the success value (mutable)

Returns
Reference to the success value
Warning
Returns static empty object if called on an error result
Note
Use ok() to check before calling for proper error handling

Definition at line 90 of file promise_result.h.

90 {
91 if (!ok()) {
92 // Return static empty object instead of crashing
93 static T empty{}; // okay static in header
94 return empty;
95 }
96 return mResult.template get<T>();
97 }
fl::variant< T, Error > mResult
bool ok() const FL_NO_EXCEPT
Check if the result is successful.
Result type for promise operations.
pair_element< I, T1, T2 >::type & get(pair< T1, T2 > &p) FL_NO_EXCEPT
Definition pair.h:119

References fl::FL_NO_EXCEPT, fl::get(), mResult, and ok().

+ Here is the call graph for this function: