|
Safe DDS
|
Template structure to hold an optional type. More...
#include <Optional.hpp>
Public Member Functions | |
| constexpr bool | has_value () const noexcept |
| Checks if the optional value is set. More... | |
| void | set (const T &new_value) noexcept |
| Sets the value of the optional. More... | |
| const T & | value () const &noexcept |
| Retrieves the value of the optional. More... | |
| const T & | value () const &&noexcept=delete |
| Deleted const getter on rvalue objects. More... | |
| T & | inner_reference () &noexcept |
| Retrieves a non-const reference to the value of the optional. More... | |
| T & | inner_reference () const &&noexcept=delete |
| Deleted getter on rvalue objects. More... | |
| void | reset () noexcept |
| Resets the optional value. More... | |
Protected Attributes | |
| bool | has_value_ = false |
| Flag indicating if the optional value is set. More... | |
| T | value_ = {} |
| The value of the optional. More... | |
Template structure to hold an optional type.
|
inlineconstexprnoexcept |
Checks if the optional value is set.
|
inlinenoexcept |
Retrieves a non-const reference to the value of the optional.
|
deletenoexcept |
Deleted getter on rvalue objects.
|
inlinenoexcept |
Resets the optional value.
This function resets the optional value, marking it as not set.
false.
|
inlinenoexcept |
Sets the value of the optional.
This function sets the value of the optional to the given value.
| new_value | The value to set. |
true.
|
deletenoexcept |
Deleted const getter on rvalue objects.
|
inlinenoexcept |
Retrieves the value of the optional.
This function returns a const reference to the value of the optional.
|
protected |
Flag indicating if the optional value is set.
|
protected |
The value of the optional.