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

◆ expected() [3/6]

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

Copy constructor (needed for some use cases like Impl initialization)

Definition at line 186 of file expected.h.

186 : mData() {
187 if (other.ok()) {
188 mData = VoidSuccess{};
189 } else {
190 auto* err = other.mData.template ptr<ErrorInfo<E>>();
191 if (err) {
192 mData = ErrorInfo<E>(err->code, err->message.c_str());
193 }
194 }
195 }
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: