|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Wrapper around std::optional<std::reference_wrapper<T>> that provides a more convenient API. More...
#include <src/utils/optional_ref.h>
Public Member Functions | |
| OptionalRef (std::nullopt_t) | |
| OptionalRef (T &ref) | |
| T & | operator* () |
| Dereference the underlying value. | |
| const T & | operator* () const |
| const T * | operator-> () const |
| T * | operator-> () |
| operator bool () const | |
| bool | has_value () const |
| Check if a value is present. | |
| T & | value () |
| Get a reference to the underlying value. | |
Data Fields | |
| std::optional< std::reference_wrapper< T > > | ref_ |
Wrapper around std::optional<std::reference_wrapper<T>> that provides a more convenient API.
This class provides a convenient wrapper around std::optional<std::reference_wrapper<T>> that allows you to easily access the underlying value without having to check for the presence of a value first.
The operator*() and value() methods return a reference to the underlying value, and the has_value() method can be used to check if a value is present.
Definition at line 25 of file optional_ref.h.
|
inline |
Definition at line 28 of file optional_ref.h.
|
inline |
Definition at line 29 of file optional_ref.h.
|
inline |
Check if a value is present.
Definition at line 67 of file optional_ref.h.
|
inlineexplicit |
Definition at line 60 of file optional_ref.h.
|
inline |
Dereference the underlying value.
Definition at line 38 of file optional_ref.h.
|
inline |
Definition at line 43 of file optional_ref.h.
|
inline |
Definition at line 54 of file optional_ref.h.
|
inline |
Definition at line 49 of file optional_ref.h.
|
inline |
Get a reference to the underlying value.
Definition at line 74 of file optional_ref.h.
| std::optional<std::reference_wrapper<T> > zrythm::utils::OptionalRef< T >::ref_ |
Definition at line 31 of file optional_ref.h.