Helper for converting an Error to a bool. This method returns true if Err is in an error state, or false if it is in a success state. Puts Err in a checked state in both cases (unlike Error::operator bool(), which only does this for success states).
| 1022 | /// in a success state. Puts Err in a checked state in both cases (unlike |
| 1023 | /// Error::operator bool(), which only does this for success states). |
| 1024 | inline bool errorToBool(Error Err) { |
| 1025 | bool IsError = static_cast<bool>(Err); |
| 1026 | if (IsError) |
| 1027 | consumeError(std::move(Err)); |
| 1028 | return IsError; |
| 1029 | } |
| 1030 | |
| 1031 | /// Helper for Errors used as out-parameters. |
| 1032 | /// |
no test coverage detected