mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 07:03:36 -04:00
dtoolbase: Fix issues building with C++20
This commit is contained in:
parent
b6096c3d40
commit
4b24ac86a5
@ -20,7 +20,7 @@ pallocator_single(TypeHandle type_handle) noexcept :
|
||||
|
||||
template<class Type>
|
||||
INLINE Type *pallocator_single<Type>::
|
||||
allocate(typename pallocator_single<Type>::size_type n, typename std::allocator<void>::const_pointer) {
|
||||
allocate(typename pallocator_single<Type>::size_type n, const void *) {
|
||||
TAU_PROFILE("pallocator_single:allocate()", " ", TAU_USER);
|
||||
// This doesn't support allocating arrays.
|
||||
assert(n == 1);
|
||||
@ -30,7 +30,7 @@ allocate(typename pallocator_single<Type>::size_type n, typename std::allocator<
|
||||
|
||||
template<class Type>
|
||||
INLINE void pallocator_single<Type>::
|
||||
deallocate(typename pallocator_single<Type>::pointer p, typename pallocator_single<Type>::size_type) {
|
||||
deallocate(Type *p, typename pallocator_single<Type>::size_type) {
|
||||
TAU_PROFILE("pallocator_single:deallocate()", " ", TAU_USER);
|
||||
StaticDeletedChain<Type>::deallocate(p, _type_handle);
|
||||
}
|
||||
@ -44,13 +44,13 @@ pallocator_array(TypeHandle type_handle) noexcept :
|
||||
|
||||
template<class Type>
|
||||
INLINE Type *pallocator_array<Type>::
|
||||
allocate(typename pallocator_array<Type>::size_type n, typename std::allocator<void>::const_pointer) {
|
||||
return (typename pallocator_array<Type>::pointer)
|
||||
allocate(typename pallocator_array<Type>::size_type n, const void *) {
|
||||
return (Type *)
|
||||
ASSUME_ALIGNED(_type_handle.allocate_array(n * sizeof(Type)), MEMORY_HOOK_ALIGNMENT);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
INLINE void pallocator_array<Type>::
|
||||
deallocate(typename pallocator_array<Type>::pointer p, typename pallocator_array<Type>::size_type) {
|
||||
deallocate(Type *p, typename pallocator_array<Type>::size_type) {
|
||||
_type_handle.deallocate_array((void *)p);
|
||||
}
|
||||
|
@ -46,10 +46,10 @@ class pallocator_single : public std::allocator<Type> {
|
||||
public:
|
||||
// Nowadays we cannot implicitly inherit typedefs from base classes in a
|
||||
// template class; we must explicitly copy them here.
|
||||
typedef typename std::allocator<Type>::pointer pointer;
|
||||
typedef typename std::allocator<Type>::reference reference;
|
||||
typedef typename std::allocator<Type>::const_pointer const_pointer;
|
||||
typedef typename std::allocator<Type>::const_reference const_reference;
|
||||
typedef Type *pointer;
|
||||
typedef Type &reference;
|
||||
typedef const Type *const_pointer;
|
||||
typedef const Type &const_reference;
|
||||
typedef typename std::allocator<Type>::size_type size_type;
|
||||
|
||||
INLINE pallocator_single(TypeHandle type_handle) noexcept;
|
||||
@ -59,9 +59,9 @@ public:
|
||||
INLINE pallocator_single(const pallocator_single<U> ©) noexcept :
|
||||
_type_handle(copy._type_handle) { }
|
||||
|
||||
INLINE Type *allocate(size_type n, std::allocator<void>::const_pointer hint = 0)
|
||||
INLINE Type *allocate(size_type n, const void *hint = 0)
|
||||
RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT);
|
||||
INLINE void deallocate(pointer p, size_type n);
|
||||
INLINE void deallocate(Type *p, size_type n);
|
||||
|
||||
template<class U> struct rebind {
|
||||
typedef pallocator_single<U> other;
|
||||
@ -75,10 +75,10 @@ class pallocator_array : public std::allocator<Type> {
|
||||
public:
|
||||
// Nowadays we cannot implicitly inherit typedefs from base classes in a
|
||||
// template class; we must explicitly copy them here.
|
||||
typedef typename std::allocator<Type>::pointer pointer;
|
||||
typedef typename std::allocator<Type>::reference reference;
|
||||
typedef typename std::allocator<Type>::const_pointer const_pointer;
|
||||
typedef typename std::allocator<Type>::const_reference const_reference;
|
||||
typedef Type *pointer;
|
||||
typedef Type &reference;
|
||||
typedef const Type *const_pointer;
|
||||
typedef const Type &const_reference;
|
||||
typedef typename std::allocator<Type>::size_type size_type;
|
||||
|
||||
INLINE pallocator_array(TypeHandle type_handle = TypeHandle::none()) noexcept;
|
||||
@ -88,9 +88,9 @@ public:
|
||||
INLINE pallocator_array(const pallocator_array<U> ©) noexcept :
|
||||
_type_handle(copy._type_handle) { }
|
||||
|
||||
INLINE Type *allocate(size_type n, std::allocator<void>::const_pointer hint = 0)
|
||||
INLINE Type *allocate(size_type n, const void *hint = 0)
|
||||
RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT);
|
||||
INLINE void deallocate(pointer p, size_type n);
|
||||
INLINE void deallocate(Type *p, size_type n);
|
||||
|
||||
template<class U> struct rebind {
|
||||
typedef pallocator_array<U> other;
|
||||
|
Loading…
x
Reference in New Issue
Block a user