This class represents an efficient way to signal success or failure. It should be preferred over the use of bool when appropriate, as it avoids all of the ambiguity that arises in interpreting a boolean result. This class is marked as NODISCARD to ensure that the result is processed. Users may explicitly discard a result by using (void), e.g. (void)functionThatReturnsALogicalResult();. Given the intended nature of this class, it generally shouldn't be used as the result of functions that very frequently have the result ignored. This class is intended to be used in conjunction with the utility functions below.
Synopsis
Declared in <llvm/Support/LogicalResult.h>
struct [[nodiscard]] LogicalResult;
Member Functions
Static Member Functions
Non-Member Functions
Name |
Description |
Utility function that returns true if the provided LogicalResult corresponds to a failure value. |
|
Utility function to generate a LogicalResult. If isFailure is true a |
|
Utility function that returns true if the provided LogicalResult corresponds to a success value. |
|
Utility function to generate a LogicalResult. If isSuccess is true a |
Derived Classes
Name |
Description |
This class represents success/failure for parsing‐like operations that find it important to chain together failable operations with |
Return Value
|
Note
|
The return value should not be discarded. |
Created with MrDocs