llvm-project
54e14c19 - [orc-rt] Make Expected's move operations conditionally noexcept. (#226393)

Commit
62 days ago
[orc-rt] Make Expected's move operations conditionally noexcept. (#226393) Expected<T>'s move constructor and move assignment operator are now noexcept whenever T's storage type is nothrow-move-constructible. Error's move operations are already noexcept, so this is the only condition under which moving an Expected can throw. This allows callables that take Expected<T> by value to be stored in noexcept-qualified move_only_functions: is_nothrow_invocable includes the initialization of by-value parameters, which previously used Expected's potentially-throwing move constructor.
Author
Parents
Loading