beman::optional::optional<T&>

A specialization of optional for references.

Synopsis

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

Types

NameDescription
iterator The type of the iterator for the optional.
value_type The type of the value contained in the optional.

Member Functions

NameDescription
optional [constructor]Constructors
~optional [destructor]Destructor.
operator= Assignment operators
and_then Applies a function to the contained value if there is one.
begin Returns an iterator to the beginning of the optional.
emplace Emplaces a new value in the optional, destroying the current one if the optional is engaged.
end Returns an iterator to the end of the optional.
has_value Checks if the optional has a value.
operator* Returns a reference to the contained value.
operator-> Returns a pointer to the contained value.
or_else Calls a function if the optional is empty.
reset Resets the optional to an empty state.
swap Swaps the contents of this optional with another.
transform Applies a function to the contained value if there is one.
value Returns the contained value if there is one, otherwise throws
value_or Returns the contained value if there is one, otherwise returns u.
operator bool Converts the optional to a boolean value.

Friends

|===
Name Description
optional Optional Objects

Created with MrDocs