Template Class ObjectPtr#

Class Documentation#

template<typename T>
class ObjectPtr#

A custom smart pointer for Object.

See also

make_object

Template Parameters:

T – the content data type.

Public Functions

inline ObjectPtr()#

default constructor

inline ObjectPtr(std::nullptr_t)#

default constructor

inline ObjectPtr(const ObjectPtr<T> &other)#

copy constructor

Parameters:

other – The value to be moved

template<typename U>
inline ObjectPtr(const ObjectPtr<U> &other)#

copy constructor

Parameters:

other – The value to be moved

inline ObjectPtr(ObjectPtr<T> &&other)#

move constructor

Parameters:

other – The value to be moved

template<typename Y>
inline ObjectPtr(ObjectPtr<Y> &&other)#

move constructor

Parameters:

other – The value to be moved

inline ~ObjectPtr()#

destructor

inline void swap(ObjectPtr<T> &other)#

Swap this array with another Object.

Parameters:

other – The other Object

inline T *get() const#
Returns:

Get the content of the pointer

inline void reset()#

reset the content of ptr to be nullptr

inline int use_count() const#
Returns:

The use count of the ptr, for debug purposes

inline bool unique() const#
Returns:

whether the reference is unique