libcommonc++  0.7
DeleteFunctor Struct Reference

A functor that deletes its argument. More...

#include <DeleteFunctor.h++>

Public Member Functions

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

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

◆ operator()()

void operator() ( T *  obj) const
inline

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