DeleteFunctor Struct Reference

A functor that deletes its argument. More...

#include <DeleteFunctor.h++>

List of all members.

Public Member Functions

template<typename T >
void operator() (T *obj) const throw ()

Detailed Description

A functor that deletes its argument.

May be used as an argument to the for_each algorithm to delete elements of a pointer-based collection. For example:

 std::vector<Foo *> vec;
 std::for_each(vec.begin(), vec.end(), DeleteFunctor());
 vec.clear();
 
Author:
Mark Lindner

Member Function Documentation

void operator() ( T *  obj  )  const throw () [inline]

The documentation for this struct was generated from the following file:
Generated on Sat Nov 26 16:49:09 2011 for libcommonc++ by  doxygen 1.6.3