Class endstone::NotNull¶
ClassList > endstone > NotNull
A wrapper around a std::shared_ptr that is guaranteed never to 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 |
|---|---|
| NotNull () = delete |
|
| NotNull (std::shared_ptr< T > ptr) |
|
| NotNull (const NotNull & other) = default |
|
| NotNull (std::shared_ptr< U > ptr) Covariant conversion from a shared_ptr of a convertible (e.g. |
|
| NotNull (const NotNull< U > & other) Covariant conversion from a NotNull of a convertible (e.g. |
|
| NotNull (std::nullptr_t) = delete |
|
| const pointer_type & | get () noexcept const |
| T & | operator* () noexcept const |
| NotNull & | operator++ () = delete |
| NotNull | operator++ (int) = delete |
| NotNull & | operator+= (std::ptrdiff_t) = delete |
| NotNull & | operator-- () = delete |
| NotNull | operator-- (int) = delete |
| NotNull & | operator-= (std::ptrdiff_t) = delete |
| T * | operator-> () noexcept const |
| NotNull & | operator= (const NotNull & other) = default |
| NotNull & | operator= (std::nullptr_t) = delete |
| void | operator[] (std::ptrdiff_t) const |
| void | swap (NotNull & other) noexcept |
Detailed Description¶
Construction from a null pointer throws, and the pointer-mutating operators are deleted. This mirrors gsl::not_null<std::shared_ptr<T>>, but throws std::invalid_argument on a null pointer (instead of a contract violation) so that a misbehaving plugin cannot crash the host.
Public Types Documentation¶
typedef element_type¶
typedef pointer_type¶
Public Functions Documentation¶
function NotNull [⅙]¶
function NotNull [2/6]¶
function NotNull [3/6]¶
function NotNull [4/6]¶
Covariant conversion from a shared_ptr of a convertible (e.g.
derived) type.
function NotNull [⅚]¶
Covariant conversion from a NotNull of a convertible (e.g.
derived) type.
function NotNull [6/6]¶
function get¶
function operator*¶
function operator++¶
function operator++¶
function operator+=¶
function operator--¶
function operator--¶
function operator-=¶
function operator->¶
function operator=¶
function operator=¶
function operator[]¶
function swap¶
The documentation for this class was generated from the following file include/endstone/util/pointers.h