ValueIsPresent provides a way to check if a value is, well, present. For pointers, this is the equivalent of checking against nullptr, for Optionals this is the equivalent of checking hasValue(). It also provides a method for unwrapping a value (think calling .value() on an optional).
Declared in <llvm/Support/Casting.h>
template<
typename T,
typename Enable = void>
struct ValueIsPresent;
| Name | Description |
|---|---|
UnwrappedType | Underlying value type after unwrapping presence wrappers. |
| Name | Description |
|---|---|
isPresent | Always true for non-nullable value types. |
unwrapValue | Returns t unchanged. |
| Name | Description |
|---|---|
ValueIsPresent<DIExpression::ExprOperand> | Treat a default-constructed expression operand as absent. |
ValueIsPresent<T> | |
ValueIsPresent<std::optional<T>> |