ElemDeleter< T, zero > Class Template Reference

Used to delete an object of type T and possibly set the pointer to NULL. More...

#include <common.h>

List of all members.

Public Member Functions

void operator() (T *&o)
 Delete o and possibly set to NULL.


Detailed Description

template<typename T, bool zero = false>
class ElemDeleter< T, zero >

Used to delete an object of type T and possibly set the pointer to NULL.

This class is useful for deleting vector or lists of objects and can be used in the following way:

 ElemDeleter<Sprite> ed;
 for_each(spriteList.begin(), spriteList.end(), ed);

This wold invoke operator() of the ed object for each object in the list of Sprite*s, spriteList.

Parameters:
T The type of pointer to delete, note that to delete an O* you should specify O as T.
zero If true, set the pointer to NULL after deleting. Poniters are always NULLed if NDEBUG was not defined.


Member Function Documentation

template<typename T, bool zero = false>
void ElemDeleter< T, zero >::operator() ( T *&  o  )  [inline]

Delete o and possibly set to NULL.


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 15:33:26 2007 for MetalWarriors by  doxygen 1.4.7