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

◆ value() [1/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 89 of file promise_result.h.

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

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

+ Here is the call graph for this function: