|
SPH
|
Non-owning wrapper of pointer. More...
#include <RawPtr.h>
Public Member Functions | |
| INLINE | RawPtr () |
| INLINE | RawPtr (std::nullptr_t) |
| template<typename T2 , typename = std::enable_if_t<std::is_convertible<T2*, T*>::value>> | |
| INLINE | RawPtr (T2 *ptr) |
| INLINE RawPtr & | operator= (std::nullptr_t) |
| template<typename T2 , typename = std::enable_if_t<std::is_convertible<T2*, T*>::value>> | |
| INLINE RawPtr & | operator= (T2 *rhs) |
| INLINE T & | operator* () const |
| INLINE T * | operator-> () const |
| INLINE | operator bool () const |
| INLINE bool | operator! () const |
| operator RawPtr< const T > () const | |
| INLINE T * | get () const |
| INLINE void | swap (RawPtr &other) |
Non-owning wrapper of pointer.
Inspired by proposal of std::observer_ptr. It mainly serves for self-documentation, clearly expressing ownership (or non-ownership in this case) of the pointer. Unlike raw pointer, it is initialized to nullptr for convenience. This is a slight overhead compared to raw pointer, negligible in most use cases. When deferencing the pointer, it checks for nullptr using assert.