|
SDL3pp
A slim C++ wrapper for SDL3
|
Optional-like shim for references. More...
Public Member Functions | |
| constexpr | OptionalRef (std::nullopt_t=std::nullopt) |
| Constructor. | |
| constexpr | OptionalRef (T &value) |
| Constructor. | |
| constexpr auto | operator<=> (const OptionalRef &) const =default |
| Constructor. | |
| constexpr bool | has_value () const |
| true if has a value. | |
| constexpr const T & | value () const |
| Returns contained value. | |
| constexpr T & | value () |
| Returns contained value. | |
| constexpr | operator T* () const |
| returns pointer if has value, nullptr otherwise. | |
| constexpr bool | operator== (std::nullopt_t) const |
| Comparison operator. | |
| constexpr T & | operator* () |
| Equivalent to value() | |
| constexpr const T & | operator* () const |
| Equivalent to value() | |
| constexpr T * | operator-> () |
| Equivalent to value() | |
| constexpr const T * | operator-> () const |
| Equivalent to value() | |
This allows us explicitly annotate optional parameters that would otherwise be references.
| T | the underlying type |