Optional Objects
Synopsis
Declared in <beman/optional/optional.hpp>
template<class T>
class optional;
Type Aliases
Name |
Description |
Type alias for the const iterator type of the optional. |
|
Type alias for the iterator type of the optional. |
|
Type alias for the value type contained in the optional. |
Member Functions
Name |
Description |
|
Constructors |
|
Destructors |
Assignment operators |
|
Applies a function to the contained value if there is one. |
|
|
|
|
|
|
|
Returns whether or not the optional has a value. |
|
Returns a reference to the contained value. |
|
Returns a pointer to the contained value. |
|
|
|
Resets the optional to an empty state, destroying the contained value if there is one. |
|
Swaps this optional with the other. |
|
Returns an optional containing the result of applying |
|
Returns a reference to the contained value. |
|
Returns the contained value if there is one, otherwise returns |
|
Converts the optional to a boolean indicating whether it has a value. |
Data Members
Name |
Description |
|
The empty state of the optional. |
|
The contained value of the optional. |
Specializations
Name |
Description |
A specialization of |
Friends
Name |
Description |
|
Optional Objects |
Non-Member Functions
Name |
Description |
Creates an optional<T> constructing the value in‐place from the given arguments. |
|
Creates an optional holding a decayed copy of the given value. |
|
Creates an optional<T> constructing the value in‐place from an initializer list and arguments. |
|
Compares an optional against a value for inequality. |
|
Compares two optionals for inequality. |
|
Orders an optional before a value with less‐than. |
|
Orders two optionals with less‐than. |
|
Orders two optionals with less‐than‐or‐equal. |
|
Orders an optional before or equal to a value. |
|
Three‐way comparison of an optional against |
|
Three‐way comparison of an optional against a value. |
|
Three‐way comparison of two optionals. |
|
Compares an optional against |
|
Compares two optionals for equality. |
|
Compares an engaged optional's value against a value for equality. |
|
Orders two optionals with greater‐than. |
|
Orders an optional after a value with greater‐than. |
|
Orders an optional after or equal to a value. |
|
Orders two optionals with greater‐than‐or‐equal. |
|
Swap |
Created with MrDocs