From 4b8a772dee5b2a7e1aa4a3e6efb8850e1f3d89eb Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 19 Mar 2007 14:42:00 +0000 Subject: [PATCH] replacement new instead of allocator::construct --- STL_Extension/include/CGAL/In_place_list.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/STL_Extension/include/CGAL/In_place_list.h b/STL_Extension/include/CGAL/In_place_list.h index da3ecc388f0..dfaeb5bae5e 100644 --- a/STL_Extension/include/CGAL/In_place_list.h +++ b/STL_Extension/include/CGAL/In_place_list.h @@ -228,20 +228,29 @@ protected: // These are the only places where the allocator gets called. pointer get_node() { - // was: return new T; pointer p = allocator.allocate(1); +#ifdef CGAL_USE_ALLOCATOR_CONSTRUCT_DESTROY allocator.construct(p, value_type()); +#else + new (p) value_type; +#endif return p; } pointer get_node( const T& t) { - // was: return new T(t); pointer p = allocator.allocate(1); +#ifdef CGAL_USE_ALLOCATOR_CONSTRUCT_DESTROY allocator.construct(p, t); +#else + new (p) value_type(t); +#endif return p; } void put_node( pointer p) { - // was: delete p; +#ifdef CGAL_USE_ALLOCATOR_CONSTRUCT_DESTROY allocator.destroy( p); +#else + p->~value_type(); +#endif allocator.deallocate( p, 1); }