ΒΆtemplate <typename T>
Optional<T> expectedToOptional(Expected<T>&& E)

Description

Convert an Expected to an Optional without doing anything. This method should be used only where an error can be considered a reasonable and expected return value. Uses of this method are potentially indicative of problems: perhaps the error should be propagated further, or the error-producer should just return an Optional in the first place.

Declared at: llvm/include/llvm/Support/Error.h:1054

Templates

T

Parameters

Expected<T>&& E