浏览代码

suggested bugfix by draisin on SourceForge site for MS .NET 2003

David Rose 21 年之前
父节点
当前提交
0740cb0449
共有 2 个文件被更改,包括 16 次插入2 次删除
  1. 8 1
      dtool/src/dtoolbase/dallocator.h
  2. 8 1
      dtool/src/dtoolbase/pallocator.h

+ 8 - 1
dtool/src/dtoolbase/dallocator.h

@@ -78,6 +78,13 @@ public:
 template<class Type>
 class dallocator : public allocator<Type> {
 public:
+  // There seems to be a bug in VC++ 2003 that requires these typedefs
+  // to be made explicitly.
+  typedef TYPENAME allocator<Type>::pointer pointer;
+  typedef TYPENAME allocator<Type>::reference reference;
+  typedef TYPENAME allocator<Type>::const_pointer const_pointer;
+  typedef TYPENAME allocator<Type>::const_reference const_reference;
+
   INLINE dallocator() throw();
 
   // template member functions in VC++ can only be defined in-class.
@@ -88,7 +95,7 @@ public:
   INLINE void deallocate(void *p, size_type n);
 
   template<class U> struct rebind { 
-	  typedef dallocator<U> other; 
+    typedef dallocator<U> other; 
   };
 };
 

+ 8 - 1
dtool/src/dtoolbase/pallocator.h

@@ -87,6 +87,13 @@ public:
 template<class Type>
 class pallocator : public allocator<Type> {
 public:
+  // There seems to be a bug in VC++ 2003 that requires these typedefs
+  // to be made explicitly.
+  typedef TYPENAME allocator<Type>::pointer pointer;
+  typedef TYPENAME allocator<Type>::reference reference;
+  typedef TYPENAME allocator<Type>::const_pointer const_pointer;
+  typedef TYPENAME allocator<Type>::const_reference const_reference;
+
   INLINE pallocator() throw();
 
   // template member functions in VC++ can only be defined in-class.
@@ -97,7 +104,7 @@ public:
   INLINE void deallocate(void *p, size_type n);
 
   template<class U> struct rebind { 
-	  typedef pallocator<U> other;
+    typedef pallocator<U> other;
   };
 };