|
Boost : |
From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2001-10-03 12:58:18
"Gennadiy E. Rozental" wrote:
>
> Hi,
>
> currently checked_delete can't be used with algorithms. For example,
>
> for_each( col.begin(), col.end(), checked_delete<some_type> );
That works with gcc, and the version below works with Comeau C++ as well.
There's no need for a function object.
Jens Maurer
#include <vector>
#include <algorithm>
#include <boost/utility.hpp>
int main()
{
std::vector<int*> col;
void (*f)(int *) = &boost::checked_delete<int>;
std::for_each( col.begin(), col.end(), f);
}
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk