diff --git a/base/stl_add.hpp b/base/stl_add.hpp index 421cd425e4..9e100ec34d 100644 --- a/base/stl_add.hpp +++ b/base/stl_add.hpp @@ -82,3 +82,10 @@ template inline bool IsSortedAndUnique(IterT beg, IterT end) return IsSortedAndUnique(beg, end, less::value_type>()); } +struct DeleteFunctor +{ + template void operator() (T const * p) const + { + delete p; + } +}; diff --git a/indexer/index.hpp b/indexer/index.hpp index 144a002bb5..2b8f8d6ed3 100644 --- a/indexer/index.hpp +++ b/indexer/index.hpp @@ -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 MultiIndexAdapter { - struct deletor_t - { - template 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(); }