raisim::AlignedAllocator
class · #include <raisim/helper.hpp>
cpp
template <typename T, std::size_t RSALOCATOR_ALIGNMENT>
class AlignedAllocatorStandard allocator that returns memory aligned to RSALOCATOR_ALIGNMENT bytes (e.g. for vectors of fixed-size Eigen-backed types).
Nested classes
structrebind — Allocator for another element type with the same alignment.
Public types
value_type
cpp
using value_type = Tsize_type
cpp
using size_type = std::size_tdifference_type
cpp
using difference_type = std::ptrdiff_tpropagate_on_container_move_assignment
cpp
using propagate_on_container_move_assignment = std::true_typeis_always_equal
cpp
using is_always_equal = std::true_typeConstructors & destructor
AlignedAllocator
cpp
AlignedAllocator() noexcept = defaultcpp
template <typename U>
AlignedAllocator(const AlignedAllocator<U, RSALOCATOR_ALIGNMENT> &) noexceptConverting copy (stateless allocator).
Public member functions
max_size
cpp
size_type max_size() const noexceptReturns the largest element count that can be requested
allocate
cpp
T *allocate(size_type n)Parameters
| Parameter | Description |
|---|---|
n (in) | number of elements |
Returns aligned uninitialized storage, or nullptr for n == 0. Throws std::bad_array_new_length if n > max_size()
deallocate
cpp
void deallocate(T *p, size_type) noexceptRelease storage obtained from allocate().
Parameters
| Parameter | Description |
|---|---|
p (in) | pointer returned by allocate() |
operator==
cpp
bool operator==(const AlignedAllocator &) const noexceptReturns true; all instances are interchangeable
operator!=
cpp
bool operator!=(const AlignedAllocator &) const noexceptReturns false; all instances are interchangeable