scoped_array< T > Class Template Reference

#include <scoped_array.hpp>

Public Types

typedef T element_type

Public Member Functions

 scoped_array (T *p=0)
 ~scoped_array ()
void reset (T *p=0)
T & operator[] (std::ptrdiff_t i) const
T * get () const
void swap (scoped_array &b)

Detailed Description

template<class T>
class scoped_array< T >

Definition at line 8 of file scoped_array.hpp.


Member Typedef Documentation

template<class T>
typedef T scoped_array< T >::element_type

Definition at line 22 of file scoped_array.hpp.


Constructor & Destructor Documentation

template<class T>
scoped_array< T >::scoped_array ( T *  p = 0  )  [inline, explicit]

Definition at line 24 of file scoped_array.hpp.

00025     :   px(p)
00026     {
00027     }

template<class T>
scoped_array< T >::~scoped_array (  )  [inline]

Definition at line 29 of file scoped_array.hpp.

00030     {
00031         delete px;
00032     }


Member Function Documentation

template<class T>
void scoped_array< T >::reset ( T *  p = 0  )  [inline]

Definition at line 34 of file scoped_array.hpp.

00035     {
00036         this_type(p).swap(*this);
00037     }

template<class T>
T& scoped_array< T >::operator[] ( std::ptrdiff_t  i  )  const [inline]

Definition at line 39 of file scoped_array.hpp.

00040     {
00041         return px[i];
00042     }

template<class T>
T* scoped_array< T >::get (  )  const [inline]

Definition at line 44 of file scoped_array.hpp.

00045     {
00046         return px;
00047     }

template<class T>
void scoped_array< T >::swap ( scoped_array< T > &  b  )  [inline]

Definition at line 49 of file scoped_array.hpp.

00050     {
00051         T *tmp = b.px;
00052         b.px = px;
00053         px = tmp;
00054     }


The documentation for this class was generated from the following file:
Generated on Sun Apr 11 12:23:11 2010 for RenderStack by  doxygen 1.6.3