Implementation of std::allocator<> More...

Classes | |
| struct | rebind |
| Its member type other is the equivalent allocator type to allocate elements of type T More... | |
Public Types | |
| typedef T | value_type |
| Type of object this allocator is creating memory. | |
| typedef uintptr_t | size_type |
| Quantities of elements. | |
| typedef intptr_t | difference_type |
| Difference between pointers. | |
| typedef T * | pointer |
| Pointer to element. | |
| typedef const T * | const_pointer |
| Pointer to constant element. | |
| typedef T & | reference |
| Reference to element. | |
| typedef const T & | const_reference |
| Reference to constant element. | |
| typedef true_type | propagate_on_container_move_assignment |
| Propagate on move assignment. | |
| typedef true_type | propagate_on_container_copy_assignment |
| Copy the allocator when copy assigned. | |
| typedef true_type | propagate_on_container_swap |
| Swap allocators on swap assignment. | |
| typedef true_type | is_always_equal |
| This allocator matches any other allocator type. | |
Public Member Functions | |
| constexpr | allocator () noexcept=default |
| Default constructor. | |
| ~allocator ()=default | |
| Default destructor. | |
| constexpr | allocator (const allocator &) noexcept=default |
| Copy constructor. | |
| constexpr | allocator (allocator &&) noexcept=default |
| Move constructor. | |
| allocator & | operator= (allocator &&) noexcept=default |
| Assignment move constructor. | |
| template<class U> | |
| allocator (const allocator< U > &) | |
| Allocator that crosses types. | |
| pointer | address (reference x) noexcept |
| Returns the address of x. | |
| const_pointer | address (const_reference x) const noexcept |
| Returns the const address of x. | |
| T * | allocate (uintptr_t n) noexcept |
| Allocate memory for n chunks of data. | |
| void | deallocate (pointer p, size_type) noexcept |
| Free memory allocated. | |
| uintptr_t | max_size () const noexcept |
| Maximum size possible to allocate. | |
| void | construct (pointer p) |
| Default constructs an object. | |
| void | destroy (pointer p) |
| Destroys the contents of an object. | |
Implementation of std::allocator<>
Implements a standard allocator using a combination of functions from C++98 through C++20. Allocates memory through operator new() and operator delete()
| typedef const T* Burger::allocator< T >::const_pointer |
Pointer to constant element.
| typedef const T& Burger::allocator< T >::const_reference |
Reference to constant element.
| typedef intptr_t Burger::allocator< T >::difference_type |
Difference between pointers.
| typedef true_type Burger::allocator< T >::is_always_equal |
This allocator matches any other allocator type.
| typedef T* Burger::allocator< T >::pointer |
Pointer to element.
| typedef true_type Burger::allocator< T >::propagate_on_container_copy_assignment |
Copy the allocator when copy assigned.
| typedef true_type Burger::allocator< T >::propagate_on_container_move_assignment |
Propagate on move assignment.
| typedef true_type Burger::allocator< T >::propagate_on_container_swap |
Swap allocators on swap assignment.
| typedef T& Burger::allocator< T >::reference |
Reference to element.
| typedef uintptr_t Burger::allocator< T >::size_type |
Quantities of elements.
| typedef T Burger::allocator< T >::value_type |
Type of object this allocator is creating memory.
|
constexprdefaultnoexcept |
Default constructor.
|
default |
Default destructor.
|
constexprdefaultnoexcept |
Copy constructor.
|
constexprdefaultnoexcept |
Move constructor.
|
inline |
Allocator that crosses types.
Since this allocator can share pools, this exists and does nothing.
|
inlinenoexcept |
Returns the const address of x.
|
inlinenoexcept |
Returns the address of x.
|
inlinenoexcept |
Allocate memory for n chunks of data.
| n | Number of elements to allocate |
|
inline |
Default constructs an object.
|
inlinenoexcept |
Free memory allocated.
| p | Pointer to memory to release |
|
inline |
Destroys the contents of an object.
|
inlinenoexcept |
Maximum size possible to allocate.
Returns the maximum number of elements, each of member type value_type (an alias of allocator's template parameter) that could potentially be allocated by a call to member allocate.
|
defaultnoexcept |
Assignment move constructor.