From 54742e34262c249c6aa17028ff57bd993faea82f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Nov 2008 12:34:21 +0000 Subject: [PATCH] use global operator new to fix compilation errors if type T overloads new (as wxObject does with wxUSE_MEMORY_TRACING) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56714 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/vector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/wx/vector.h b/include/wx/vector.h index 720d826ded..2337d3d326 100644 --- a/include/wx/vector.h +++ b/include/wx/vector.h @@ -66,7 +66,7 @@ struct wxVectorMemOpsGeneric T *mem = (T*)::operator new(newCapacity * sizeof(T)); for ( size_t i = 0; i < occupiedSize; i++ ) { - new(mem + i) T(old[i]); + ::new(mem + i) T(old[i]); old[i].~T(); } ::operator delete(old); @@ -242,7 +242,7 @@ public: // use placement new to initialize new object in preallocated place in // m_values and store 'v' in it: void* const place = m_values + m_size; - new(place) value_type(v); + ::new(place) value_type(v); // only increase m_size if the ctor didn't throw an exception; notice // that if it _did_ throw, everything is OK, because we only increased