uninitialized_array< T > Class Template Reference

Array with runtime determined size which is not initialized on creation. More...

#include <misc.h>

Public Member Functions

 uninitialized_array (int numElem)
 ~uninitialized_array ()
 operator T * ()
 this opens the door to basically any operation allowed on C style arrays

Private Member Functions

 uninitialized_array (const uninitialized_array &)
uninitialized_arrayoperator= (const uninitialized_array &)

Private Attributes

T * elems

Detailed Description

template<typename T>
class uninitialized_array< T >

Array with runtime determined size which is not initialized on creation.

This RAII type is ment as output buffer for interfaces with e.g. C, where initializing a temp buffer to zero is waste of time because it gets overwritten with real data anyway.

It's ment as replacement for the error prone pattern of allocating scratch/buffer memory using new/delete and using a std::vector "cast" to a C style array.

Definition at line 18 of file misc.h.


Constructor & Destructor Documentation

template<typename T >
uninitialized_array< T >::uninitialized_array ( int  numElem  )  [inline]

Definition at line 21 of file misc.h.

template<typename T >
uninitialized_array< T >::~uninitialized_array (  )  [inline]

Definition at line 24 of file misc.h.

template<typename T >
uninitialized_array< T >::uninitialized_array ( const uninitialized_array< T > &   )  [private]

Member Function Documentation

template<typename T >
uninitialized_array< T >::operator T * (  )  [inline]

this opens the door to basically any operation allowed on C style arrays

Definition at line 29 of file misc.h.

template<typename T >
uninitialized_array& uninitialized_array< T >::operator= ( const uninitialized_array< T > &   )  [private]

Field Documentation

template<typename T >
T* uninitialized_array< T >::elems [private]

Definition at line 32 of file misc.h.


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

Generated on Thu Dec 29 00:11:49 2011 for SpringLobby by doxygen 1.6.3