porting bugs

This commit is contained in:
David Rose 2001-06-06 01:19:41 +00:00
parent b78b500300
commit f4c58e7c2b
3 changed files with 13 additions and 11 deletions

View File

@ -43,8 +43,9 @@ allocate(pallocator<Type>::size_type n, allocator<void>::const_pointer) {
template<class Type> template<class Type>
INLINE void pallocator<Type>:: INLINE void pallocator<Type>::
deallocate(pallocator<Type>::pointer p, allocator<Type>::size_type) { //deallocate(pallocator<Type>::pointer p, allocator<Type>::size_type) {
(*global_operator_delete)(p); deallocate(void *p, allocator<Type>::size_type) {
(*global_operator_delete)((void *)p);
} }
#endif // NDEBUG #endif // NDEBUG

View File

@ -55,7 +55,8 @@ class pallocator : public allocator<Type> {
public: public:
#ifndef NDEBUG #ifndef NDEBUG
INLINE pointer allocate(size_type n, allocator<void>::const_pointer hint = 0); INLINE pointer allocate(size_type n, allocator<void>::const_pointer hint = 0);
INLINE void deallocate(pointer p, size_type n); // INLINE void deallocate(pointer p, size_type n);
INLINE void deallocate(void *p, size_type n);
#endif // NDEBUG #endif // NDEBUG
}; };
#endif // GCC_STYLE_ALLOCATOR #endif // GCC_STYLE_ALLOCATOR

View File

@ -32,11 +32,11 @@
// memory. // memory.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Value, class Compare = less<Key> > template<class Key, class Value, class Compare = less<Key> >
class pmap : public map<Key, Value, Compare, pallocator<pair<Key, Value> > > { class pmap : public map<Key, Value, Compare, pallocator<Value> > {
public: public:
pmap() : map<Key, Value, Compare, pallocator<pair<Key, Value> > >() { } pmap() : map<Key, Value, Compare, pallocator<Value> >() { }
pmap(const pmap<Key, Value, Compare> &copy) : map<Key, Value, Compare, pallocator<pair<Key, Value> > >(copy) { } pmap(const pmap<Key, Value, Compare> &copy) : map<Key, Value, Compare, pallocator<Value> >(copy) { }
pmap(const Compare &comp) : map<Key, Compare, pallocator<Key> >(comp) { } pmap(const Compare &comp) : map<Key, Value, Compare, pallocator<Value> >(comp) { }
}; };
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -47,11 +47,11 @@ public:
// memory. // memory.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
template<class Key, class Value, class Compare = less<Key> > template<class Key, class Value, class Compare = less<Key> >
class pmultimap : public multimap<Key, Value, Compare, pallocator<pair<Key, Value> > > { class pmultimap : public multimap<Key, Value, Compare, pallocator<Value> > {
public: public:
pmultimap() : multimap<Key, Value, Compare, pallocator<pair<Key, Value> > >() { } pmultimap() : multimap<Key, Value, Compare, pallocator<Value> >() { }
pmultimap(const pmultimap<Key, Value, Compare> &copy) : multimap<Key, Value, Compare, pallocator<pair<Key, Value> > >(copy) { } pmultimap(const pmultimap<Key, Value, Compare> &copy) : multimap<Key, Value, Compare, pallocator<Value> >(copy) { }
pmultimap(const Compare &comp) : multimap<Key, Compare, pallocator<Key> >(comp) { } pmultimap(const Compare &comp) : multimap<Key, Value, Compare, pallocator<Value> >(comp) { }
}; };
#endif #endif