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

◆ operator=() [2/4]

template<typename E>
expected & fl::expected< void, E >::operator= ( const expected< void, E > & other)
inline

Copy assignment.

Definition at line 198 of file expected.h.

198 {
199 if (this != &other) {
200 if (other.ok()) {
201 mData = VoidSuccess{};
202 } else {
203 auto* err = other.mData.template ptr<ErrorInfo<E>>();
204 if (err) {
205 mData = ErrorInfo<E>(err->code, err->message.c_str());
206 }
207 }
208 }
209 return *this;
210 }
fl::variant< VoidSuccess, ErrorInfo< E > > mData
Definition expected.h:216
bool ok() const FL_NOEXCEPT
Check if operation succeeded.
Definition expected.h:82
fl::variant< T, ErrorInfo< E > > mData
Definition expected.h:134
const char * message() const FL_NOEXCEPT
Get error message (only meaningful if !ok())
Definition expected.h:94
expected type for operations that can fail (C++23-style)
Definition expected.h:79

References expected(), FL_NOEXCEPT, and mData.

+ Here is the call graph for this function: