PlayRho  2.0.0
An interactive physics engine & library.
playrho::pmr::polymorphic_allocator< T > Class Template Reference

Similar to a std::pmr::polymorphic_allocator. More...

#include <playrho/pmr/MemoryResource.hpp>

Public Types

using value_type = T
 Value type alias.
 

Public Member Functions

 polymorphic_allocator (const polymorphic_allocator &)=default
 Copy constructor.
 
template<class U >
 polymorphic_allocator (const polymorphic_allocator< U > &other) noexcept
 Compatible value type copy constructor.
 
 polymorphic_allocator (ResourceType resource=nullptr) noexcept
 Initializing constructor.
 
T * allocate (std::size_t n)
 Allocates buffer for array of n elements.
 
void deallocate (T *p, std::size_t n) noexcept
 Deallocates buffer p of array of n elements.
 
polymorphic_allocatoroperator= (const polymorphic_allocator &)=delete
 Copy assignment is explicitly deleted.
 
ResourceType resource () const noexcept
 Gets the resource property of this instance.
 

Friends

bool operator!= (const polymorphic_allocator &lhs, const polymorphic_allocator &rhs) noexcept
 Inequality support.
 
bool operator== (const polymorphic_allocator &lhs, const polymorphic_allocator &rhs) noexcept
 Equality support.
 

Detailed Description

template<class T>
class playrho::pmr::polymorphic_allocator< T >

Similar to a std::pmr::polymorphic_allocator.

Note
This provides something of a work around type for C++ libraries that don't yet support std::pmr (like pre LLVM 16 and Apple Clang).

The documentation for this class was generated from the following file: