From 04a020b0a3018608ac013fa0a271ac168f797034 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 6 Jul 2007 23:42:40 +0000 Subject: [PATCH] ! USE_STL_ALLOCATOR --- dtool/src/dtoolbase/pvector.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/dtool/src/dtoolbase/pvector.h b/dtool/src/dtoolbase/pvector.h index a2cb39834a..5afe4d4350 100644 --- a/dtool/src/dtoolbase/pvector.h +++ b/dtool/src/dtoolbase/pvector.h @@ -26,9 +26,21 @@ #include "register_type.h" #ifndef USE_STL_ALLOCATOR -// If we're not using custom allocators, just use the standard class -// definition. -#define pvector vector +// If we're not using custom allocators, we still need to use make a +// custom class definition, so we can discard the type_handle +// parameter. +template +class pvector : public vector { +public: + typedef vector base_class; + typedef TYPENAME base_class::size_type size_type; + + pvector(TypeHandle type_handle = pvector_type_handle) : base_class() { } + pvector(const pvector ©) : base_class(copy) { } + pvector(size_type n, TypeHandle type_handle = pvector_type_handle) : base_class(n, Type()) { } + pvector(size_type n, const Type &value, TypeHandle type_handle = pvector_type_handle) : base_class(n, value) { } + pvector(const Type *begin, const Type *end, TypeHandle type_handle = pvector_type_handle) : base_class(begin, end) { } +}; #else