beman::optional::optional

Optional Objects

Synopsis

Declared in <beman/optional/optional.hpp>
template<class T>
class optional;

Types

NameDescription
const_iterator Type alias for the const iterator type of the optional.
iterator Type alias for the iterator type of the optional.
value_type Type alias for the value type contained in the optional.

Member Functions

NameDescription
optional [constructor]Constructors
~optional [destructor]Destructors
operator= Assignment operators
and_then Applies a function to the contained value if there is one.
begin begin overloads
emplace emplace overloads
end end overloads
has_value Returns whether or not the optional has a value.
operator* Returns a reference to the contained value.
operator-> Returns a pointer to the contained value.
or_else or_else overloads
reset Resets the optional to an empty state, destroying the contained value if there is one.
swap Swaps this optional with the other.
transform Returns an optional containing the result of applying f to the contained value, or an empty optional if there is no contained value.
value Returns a reference to the contained value.
value_or Returns the contained value if there is one, otherwise returns u.
operator bool Converts the optional to a boolean indicating whether it has a value.

Data Members

NameDescription
_ [variant member]The empty state of the optional.
value_ [variant member]The contained value of the optional.

Friends

|===
Name Description
optional Optional Objects

Non-Member Functions

Name Description
make_optionalMake an optional
operator!=Inequality operator
operator!=Inequality operator
operator<Less-than operator
operator<Less-than operator
operator<=Less-than-or-equal operator
operator<=Less-than-or-equal operator
operator<=>Three-way comparison operator
operator<=>Three-way comparison operator
operator<=>Three-way comparison operator
operator==Equality operator
operator==Equality operator
operator==Equality operator
operator>Greater-than operator
operator>Greater-than operator
operator>=Greater-than-or-equal operator
operator>=Greater-than-or-equal operator
swapSwap

Created with MrDocs