LLVM: llvm::LogicalResult Struct Reference (original) (raw)
This class represents an efficient way to signal success or failure. More...
#include "[llvm/Support/LogicalResult.h](LogicalResult%5F8h%5Fsource.html)"
| Static Public Member Functions | |
|---|---|
| static LogicalResult | success (bool IsSuccess=true) |
| If isSuccess is true a success result is generated, otherwise a 'failure' result is generated. | |
| static LogicalResult | failure (bool IsFailure=true) |
| If isFailure is true a failure result is generated, otherwise a 'success' result is generated. |
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.
Definition at line 25 of file LogicalResult.h.
◆ failed()
| bool llvm::LogicalResult::failed ( ) const | inlineconstexpr |
|---|
◆ failure()
If isFailure is true a failure result is generated, otherwise a 'success' result is generated.
Definition at line 35 of file LogicalResult.h.
Referenced by llvm::failure().
◆ succeeded()
| bool llvm::LogicalResult::succeeded ( ) const | inlineconstexpr |
|---|
◆ success()
The documentation for this struct was generated from the following file:
- include/llvm/Support/LogicalResult.h