Synopsis

Declared in <llvm/Support/MSVCErrorWorkarounds.h>

template<typename T>
class MSVCPExpected
    : public Expected<T>

Base Classes

Name

Description

Expected<T>

Tagged union holding either a T or a Error.

Type Aliases

Name

Description

storage_type

Storage type for either a value or an error payload.

value_type

Value type held when the Expected represents success.

Member Functions

Name

Description

MSVCPExpected [constructor]

Constructors

operator=

Move‐assign from another Expected<T>.

errorIsA

Check that this Expected<T> is an error of type ErrT.

get

get overloads

moveInto

Returns takeError() after moving the held T (if any) into V.

operator*

Dereference operators

operator‐>

Member access operators

takeError

Take ownership of the stored error. After calling this the Expected<T> is in an indeterminate state that can only be safely destructed. No further calls (beside the destructor) should be made on the Expected<T> value.

operator bool

Return false if there is an error.

Data Members

Name

Description

ErrorStorage [variant member]

Storage for the contained error payload.

TStorage [variant member]

Storage for the contained value.

Non-Member Functions

Name

Description

expectedToErrorOr

Convert an Expected<T> to an ErrorOr<T>.

expectedToOptional

Convert an Expected to an std::optional without doing anything. This method should be used only where an error can be considered a reasonable and expected return value.

Created with MrDocs