42 using producer = std::function<alternative(void)>;
const alternative & value() const
Retrieve the underlying sum type.
Global namespace of the SCL.
static Optional ref(const value_type &ref)
Construct an optional from a reference to an object.
std::function< alternative(void)> producer
The type of function that produces the alternative.
void ensureGenerated() const
Ensure that the payload has been generated before use.
StreamIteratorPayload(producer prod)
Construct a payload with its producer function.
bool isValid() const
Determine whether or not the underlying sum type stores a value.
constexpr None none
A constant global variable of type None.
bool hasValue() const
Determines whether or not this Optional<T> is empty.
bool isInvalid() const
Determine whether or not the underlying sum type store an invalid tag.
T value_type
The type of value stored.
producer gen
The producer function that gives an optional result.
static constexpr StreamIteratorPayload withoutValue()
Create a payload with an invalid tag set.
A class representing a stream iterator's payload.
static constexpr StreamIteratorPayload withValue(const T &value)
Create a payload with a value set.
alternative alt
The optional result (as a cache)
bool generated
Computation cache flag.