folly::expected_detail::ExpectedStorage

Storage backing an Expected, holding either a value or an error.

Synopsis

Declared in <folly/Expected.h>

template<
    class Value,
    class Error,
    StorageType = expected_detail::getStorageType<Value, Error>()>
struct ExpectedStorage;

Type Aliases

NameDescription
error_type The stored error type.
value_type The stored value type.

Member Functions

NameDescription
ExpectedStorage [constructor]Constructors
assign Copies or moves the active alternative from another storage.
assignError Assigns an error into the storage.
assignValue Assigns a value into the storage.
clear Releases any held object; a no-op for trivial storage.
error Accesses the stored error.
value Accesses the stored value.

Static Member Functions

NameDescription
uninitializedByException Reports whether construction was interrupted by an exception.

Data Members

NameDescription
ch_ [variant member]Placeholder used while empty.
error_ [variant member]The error alternative.
value_ [variant member]The value alternative.
which_ Discriminator for the active alternative.

Specializations

Name
ExpectedStorage<Value, Error, StorageType::ePODStruct>
ExpectedStorage<Value, Error, StorageType::eUnion>