SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL::OptionalRef< T > Class Template Reference

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().

Detailed Description

template<class T>
class SDL::OptionalRef< T >

Optional-like shim for references.

This allows us explicitly annotate optional parameters that would otherwise be references.

Template Parameters
Tthe underlying type

The documentation for this class was generated from the following file: