Move deletor_t to stl_add.hpp and rename it to DeleteFunctor.

This commit is contained in:
Yury Melnichek 2011-01-02 20:58:04 +01:00 committed by Alex Zolotarev
parent 0386474e68
commit 0eb019aaa9
2 changed files with 9 additions and 6 deletions

View file

@ -82,3 +82,10 @@ template <class IterT> inline bool IsSortedAndUnique(IterT beg, IterT end)
return IsSortedAndUnique(beg, end, less<typename iterator_traits<IterT>::value_type>());
}
struct DeleteFunctor
{
template <typename T> void operator() (T const * p) const
{
delete p;
}
};

View file

@ -8,6 +8,7 @@
#include "../geometry/rect2d.hpp"
#include "../coding/varint.hpp"
#include "../base/base.hpp"
#include "../base/stl_add.hpp"
#include "../std/string.hpp"
#include "../std/vector.hpp"
@ -65,11 +66,6 @@ public:
template <class IndexT> class MultiIndexAdapter
{
struct deletor_t
{
template <class T> void operator() (T * p) { delete p; }
};
public:
typedef typename IndexT::Query Query;
@ -114,7 +110,7 @@ public:
void Clean()
{
for_each(m_Indexes.begin(), m_Indexes.end(), deletor_t());
for_each(m_Indexes.begin(), m_Indexes.end(), DeleteFunctor());
m_Indexes.clear();
}