Class endstone::Nullable¶
ClassList > endstone > Nullable
A wrapper around a std::shared_ptr that may be null. More...
#include <endstone/util/pointers.h>
Public Types¶
| Type | Name |
|---|---|
| typedef T | element_type |
| typedef std::shared_ptr< T > | pointer_type |
Public Functions¶
| Type | Name |
|---|---|
| constexpr | Nullable () noexcept |
| constexpr | Nullable (std::nullptr_t) noexcept |
| Nullable (std::shared_ptr< T > ptr) |
|
| Nullable (const NotNull< T > & other) |
|
| Nullable (std::shared_ptr< U > ptr) Covariant conversion from a shared_ptr of a convertible (e.g. |
|
| Nullable (const Nullable< U > & other) Covariant conversion from a Nullable of a convertible (e.g. |
|
| Nullable (const NotNull< U > & other) Covariant conversion from a NotNull of a convertible (e.g. |
|
| const pointer_type & | get () noexcept const |
| operator bool () noexcept const |
|
| T & | operator* () noexcept const |
| T * | operator-> () noexcept const |
| bool | operator== (std::nullptr_t) noexcept const |
| T & | value () const Returns a reference to the contained value, throwing std::runtime_error if this is null. |
| pointer_type | value_or (pointer_type default_value) const Returns the contained pointer if present, otherwise the supplied default. |
Detailed Description¶
Convertible from a NotNull, and contextually convertible to bool to test for a value.
Public Types Documentation¶
typedef element_type¶
typedef pointer_type¶
Public Functions Documentation¶
function Nullable [1/7]¶
function Nullable [2/7]¶
function Nullable [3/7]¶
function Nullable [4/7]¶
function Nullable [5/7]¶
Covariant conversion from a shared_ptr of a convertible (e.g.
derived) type.
function Nullable [6/7]¶
Covariant conversion from a Nullable of a convertible (e.g.
derived) type.
function Nullable [7/7]¶
Covariant conversion from a NotNull of a convertible (e.g.
derived) type.
function get¶
function operator bool¶
function operator*¶
function operator->¶
function operator==¶
function value¶
Returns a reference to the contained value, throwing std::runtime_error if this is null.
function value_or¶
Returns the contained pointer if present, otherwise the supplied default.
The documentation for this class was generated from the following file include/endstone/util/pointers.h