lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
|
Scoped pointer class that releases the object pointed to on destruction. More...
#include <scoped_ptr.h>
Inherits noncopyable.
Public Types | |
typedef lean::strip_array < Type >::type | object_type |
Type of the object pointed to. | |
typedef object_type * | value_type |
Type of the pointer stored by this scoped pointer. | |
Public Member Functions | |
scoped_ptr (object_type *object=nullptr) | |
Constructs a scoped pointer from the given object pointer. | |
template<class Type2 > | |
scoped_ptr (Type2 *object) | |
Constructs a scoped pointer from the given object pointer. | |
LEAN_INLINE | ~scoped_ptr () |
Releases the object pointed to. | |
LEAN_INLINE object_type * | detatch () |
Detatches the object pointed to. | |
scoped_ptr & | operator= (object_type *object) |
Replaces the stored object with the given object. [ESA] | |
LEAN_INLINE object_type *const & | get () const |
Gets the object stored by this scoped pointer. | |
LEAN_INLINE object_type & | operator* () const |
Gets the object stored by this scoped pointer. | |
LEAN_INLINE object_type * | operator-> () const |
Gets the object stored by this scoped pointer. | |
LEAN_INLINE | operator object_type * () const |
Gets the object stored by this scoped pointer. |
Scoped pointer class that releases the object pointed to on destruction.