From 4a62e68b09eb7ac3d3f7e51d93b88d7e41727930 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Sat, 14 Oct 2017 11:15:08 +0200 Subject: [PATCH] [DEV] remove dead code --- etk/Vector.hpp | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/etk/Vector.hpp b/etk/Vector.hpp index 861d19e..0d73b67 100644 --- a/etk/Vector.hpp +++ b/etk/Vector.hpp @@ -8,22 +8,11 @@ #include //#include #include +#include //#define ETK_VECTOR_DEBUG(...) printf(__VA_ARGS__) #define ETK_VECTOR_DEBUG(...) do {} while (false) -// it is define bu generic "include " ==> no double define of placement new -#ifndef _NEW - // Default placement versions of operator new. - inline void* operator new(size_t, char* _p) throw() { - ETK_VECTOR_DEBUG("plop\n"); - return _p; - } - inline void operator delete (void*, char*) throw() { - - } -#endif - namespace etk { class Stream; /** @@ -252,7 +241,7 @@ namespace etk { changeAllocation(_count); // instanciate all objects for (size_t iii=0; iii<_count; ++iii) { - new ((char*)&m_data[iii]) ETK_VECTOR_TYPE(); + new ((char*)&m_data[iii]) ETK_VECTOR_TYPE(); } m_size = _count; } @@ -279,11 +268,7 @@ namespace etk { m_allocated(0) { reserve(_obj.m_size); for(size_t iii=0; iii<_obj.m_size; iii++) { - #if 0 - pushBack(_obj.m_data[iii]); - #else - new ((char*)&m_data[iii]) ETK_VECTOR_TYPE(etk::move(_obj.m_data[iii])); - #endif + new ((char*)&m_data[iii]) ETK_VECTOR_TYPE(etk::move(_obj.m_data[iii])); } m_size = _obj.m_size; } @@ -357,11 +342,7 @@ namespace etk { // Force a specicfic size reserve(_obj.m_size); for(size_t iii=0; iii<_obj.m_size; iii++) { - #if 0 - pushBack(_obj.m_data[iii]); - #else - new ((char*)&m_data[iii]) ETK_VECTOR_TYPE(etk::move(_obj.m_data[iii])); - #endif + new ((char*)&m_data[iii]) ETK_VECTOR_TYPE(etk::move(_obj.m_data[iii])); } m_size = _obj.m_size; // Return the current pointer