diff --git a/src/core/mem_func.hpp b/src/core/mem_func.hpp index 12acce13fc..81bf903fea 100644 --- a/src/core/mem_func.hpp +++ b/src/core/mem_func.hpp @@ -65,37 +65,4 @@ static inline int MemCmpT(const T *ptr1, const T *ptr2, size_t num = 1) return memcmp(ptr1, ptr2, num * sizeof(T)); } -/** - * Type safe memory reverse operation. - * Reverse a block of memory in steps given by the - * type of the pointers. - * - * @param ptr1 Start-pointer to the block of memory. - * @param ptr2 End-pointer to the block of memory. - */ -template -static inline void MemReverseT(T *ptr1, T *ptr2) -{ - assert(ptr1 != nullptr && ptr2 != nullptr); - assert(ptr1 < ptr2); - - do { - Swap(*ptr1, *ptr2); - } while (++ptr1 < --ptr2); -} - -/** - * Type safe memory reverse operation (overloaded) - * - * @param ptr Pointer to the block of memory. - * @param num The number of items we want to reverse. - */ -template -static inline void MemReverseT(T *ptr, size_t num) -{ - assert(ptr != nullptr); - - MemReverseT(ptr, ptr + (num - 1)); -} - #endif /* MEM_FUNC_HPP */ diff --git a/src/sortlist_type.h b/src/sortlist_type.h index 21cbca16fa..45799cd835 100644 --- a/src/sortlist_type.h +++ b/src/sortlist_type.h @@ -234,7 +234,7 @@ public: { this->flags ^= VL_DESC; - if (this->IsSortable()) MemReverseT(std::vector::data(), std::vector::size()); + if (this->IsSortable()) std::reverse(std::vector::begin(), std::vector::end()); } /**