lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
Public Types | Public Member Functions
lean::smart::scoped_ptr< Type, ReleasePolicy > Class Template Reference

Scoped pointer class that releases the object pointed to on destruction. More...

#include <scoped_ptr.h>

Inherits noncopyable.

List of all members.

Public Types

typedef lean::strip_array
< Type >::type 
object_type
 Type of the object pointed to.
typedef object_typevalue_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_typedetatch ()
 Detatches the object pointed to.
scoped_ptroperator= (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_typeoperator* () const
 Gets the object stored by this scoped pointer.
LEAN_INLINE object_typeoperator-> () const
 Gets the object stored by this scoped pointer.
LEAN_INLINE operator object_type * () const
 Gets the object stored by this scoped pointer.

Detailed Description

template<class Type, class ReleasePolicy = generic_ptr_policy<Type>>
class lean::smart::scoped_ptr< Type, ReleasePolicy >

Scoped pointer class that releases the object pointed to on destruction.


The documentation for this class was generated from the following file: