Crashpad
Classes | Public Types | Public Member Functions | List of all members
crashpad::AlignedAllocator< T, Alignment > Struct Template Reference

A standard allocator that aligns its allocations as requested, suitable for use as an allocator in standard containers. More...

#include "util/stdlib/aligned_allocator.h"

Classes

struct  rebind
 

Public Types

using value_type = T
 
using pointer = T *
 
using const_pointer = const T *
 
using reference = T &
 
using const_reference = const T &
 
using size_type = size_t
 
using difference_type = ptrdiff_t
 

Public Member Functions

 AlignedAllocator (const AlignedAllocator &other) noexcept
 
template<typename U >
 AlignedAllocator (const AlignedAllocator< U, Alignment > &other) noexcept
 
pointer address (reference x) const noexcept
 
const_pointer address (const_reference x) const noexcept
 
pointer allocate (size_type n, std::allocator< void >::const_pointer hint=0)
 
void deallocate (pointer p, size_type n)
 
size_type max_size () const noexcept
 
template<class U , class... Args>
void construct (U *p, Args &&... args)
 
template<class U >
void destroy (U *p)
 

Detailed Description

template<class T, size_t Alignment = alignof(T)>
struct crashpad::AlignedAllocator< T, Alignment >

A standard allocator that aligns its allocations as requested, suitable for use as an allocator in standard containers.

This is similar to std::allocator<T>, with the addition of an alignment guarantee. Alignment must be a power of 2. If Alignment is not specified, the default alignment for type T is used.


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