OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
ossia::aligned_pod_allocator< T, Align > Struct Template Reference

An allocator which guarantees that the memory is aligned on Align. More...

Detailed Description

template<class T, std::size_t Align>
struct ossia::aligned_pod_allocator< T, Align >

An allocator which guarantees that the memory is aligned on Align.

This must not be aliased away for any build configuration: users of ossia::pod_vector are entitled to do aligned SIMD loads on its contents in debug builds too.

Public Types

using value_type = T
 

Public Member Functions

 aligned_pod_allocator (const aligned_pod_allocator &) noexcept=default
 
 aligned_pod_allocator (aligned_pod_allocator &&) noexcept=default
 
aligned_pod_allocatoroperator= (const aligned_pod_allocator &) noexcept=default
 
aligned_pod_allocatoroperator= (aligned_pod_allocator &&) noexcept=default
 
template<class U >
 aligned_pod_allocator (const aligned_pod_allocator< U, Align > &) noexcept
 

Static Public Member Functions

static T * allocate (std::size_t num) noexcept
 
static void deallocate (T *p, std::size_t) noexcept
 

Static Public Attributes

static constexpr std::size_t alignment = Align
 
static constexpr bool needs_aligned_alloc = Align > alignof(std::max_align_t)