Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
STLAlignedAllocator< T, N > Class Template Reference

STL allocator that takes care that memory is aligned to N bytes. More...

#include <STLAlignedAllocator.h>

Inheritance diagram for STLAlignedAllocator< T, N >:
Array< uint8, STLAlignedAllocator< uint8, JPH_CACHE_LINE_SIZE > > ByteBuffer

Classes

struct  rebind
 Converting to allocator for other type. More...

Public Types

using value_type = T
using pointer = T *
 Pointer to type.
using const_pointer = const T *
using reference = T &
using const_reference = const T &
using size_type = size_t
using difference_type = ptrdiff_t
using is_always_equal = std::true_type
 The allocator is stateless.
using propagate_on_container_move_assignment = std::true_type
 Allocator supports moving.

Public Member Functions

 STLAlignedAllocator ()=default
 Constructor.
template<typename T2>
 STLAlignedAllocator (const STLAlignedAllocator< T2, N > &)
 Constructor from other allocator.
pointer allocate (size_type inN)
 Allocate memory.
void deallocate (pointer inPointer, size_type)
 Free memory.
bool operator== (const STLAlignedAllocator< T, N > &) const
 Allocators are stateless so assumed to be equal.
bool operator!= (const STLAlignedAllocator< T, N > &) const

Detailed Description

template<typename T, size_t N>
class STLAlignedAllocator< T, N >

STL allocator that takes care that memory is aligned to N bytes.

Member Typedef Documentation

◆ const_pointer

template<typename T, size_t N>
using STLAlignedAllocator< T, N >::const_pointer = const T *

◆ const_reference

template<typename T, size_t N>
using STLAlignedAllocator< T, N >::const_reference = const T &

◆ difference_type

template<typename T, size_t N>
using STLAlignedAllocator< T, N >::difference_type = ptrdiff_t

◆ is_always_equal

template<typename T, size_t N>
using STLAlignedAllocator< T, N >::is_always_equal = std::true_type

The allocator is stateless.

◆ pointer

template<typename T, size_t N>
using STLAlignedAllocator< T, N >::pointer = T *

Pointer to type.

◆ propagate_on_container_move_assignment

template<typename T, size_t N>
using STLAlignedAllocator< T, N >::propagate_on_container_move_assignment = std::true_type

Allocator supports moving.

◆ reference

template<typename T, size_t N>
using STLAlignedAllocator< T, N >::reference = T &

Reference to type. Can be removed in C++20.

◆ size_type

template<typename T, size_t N>
using STLAlignedAllocator< T, N >::size_type = size_t

◆ value_type

template<typename T, size_t N>
using STLAlignedAllocator< T, N >::value_type = T

Constructor & Destructor Documentation

◆ STLAlignedAllocator() [1/2]

template<typename T, size_t N>
STLAlignedAllocator< T, N >::STLAlignedAllocator ( )
inlinedefault

Constructor.

◆ STLAlignedAllocator() [2/2]

template<typename T, size_t N>
template<typename T2>
STLAlignedAllocator< T, N >::STLAlignedAllocator ( const STLAlignedAllocator< T2, N > & )
inlineexplicit

Constructor from other allocator.

Member Function Documentation

◆ allocate()

template<typename T, size_t N>
pointer STLAlignedAllocator< T, N >::allocate ( size_type inN)
inline

Allocate memory.

◆ deallocate()

template<typename T, size_t N>
void STLAlignedAllocator< T, N >::deallocate ( pointer inPointer,
size_type  )
inline

Free memory.

◆ operator!=()

template<typename T, size_t N>
bool STLAlignedAllocator< T, N >::operator!= ( const STLAlignedAllocator< T, N > & ) const
inline

◆ operator==()

template<typename T, size_t N>
bool STLAlignedAllocator< T, N >::operator== ( const STLAlignedAllocator< T, N > & ) const
inline

Allocators are stateless so assumed to be equal.


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