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

◆ value() [1/2]

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

Get the success value (const)

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 77 of file promise_result.h.

77 {
78 if (!ok()) {
79 // Return static empty object instead of crashing
80 static const T empty{};
81 return empty;
82 }
83 return mResult.template get<T>();
84 }
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().

Referenced by PromiseResult(), and PromiseResult().

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