|
LLDB mainline
|
A non-nullable shared pointer that always holds a valid object. More...
#include <NonNullSharedPtr.h>
Public Member Functions | |
| NonNullSharedPtr (const std::shared_ptr< T > &t) | |
| NonNullSharedPtr (std::shared_ptr< T > &&t) | |
| NonNullSharedPtr (const NonNullSharedPtr &other) | |
| NonNullSharedPtr (NonNullSharedPtr &&other) | |
| NonNullSharedPtr & | operator= (const NonNullSharedPtr &other) |
| NonNullSharedPtr & | operator= (NonNullSharedPtr &&other) |
| void | swap (NonNullSharedPtr &other) |
| void | reset ()=delete |
| Explicitly deleted operations that could introduce nullptr. | |
| void | reset (T *ptr)=delete |
Private Types | |
| using | Base = std::shared_ptr<T> |
A non-nullable shared pointer that always holds a valid object.
NonNullSharedPtr is a smart pointer wrapper around std::shared_ptr that guarantees the pointer is never null.
This class is used for enforcing invariants at the type level and eliminating entire classes of null pointer bugs.
| T | The type of object to manage. Must be default-constructible. |
Definition at line 26 of file NonNullSharedPtr.h.
|
private |
Definition at line 27 of file NonNullSharedPtr.h.
|
inline |
Definition at line 30 of file NonNullSharedPtr.h.
|
inline |
Definition at line 35 of file NonNullSharedPtr.h.
|
inline |
Definition at line 42 of file NonNullSharedPtr.h.
|
inline |
Definition at line 44 of file NonNullSharedPtr.h.
|
inline |
Definition at line 46 of file NonNullSharedPtr.h.
|
inline |
Definition at line 51 of file NonNullSharedPtr.h.
|
delete |
Explicitly deleted operations that could introduce nullptr.
|
delete |
|
inline |
Definition at line 62 of file NonNullSharedPtr.h.
Referenced by swap().