85 template <
typename value_t,
size_t alignment_v = __STDCPP_DEFAULT_NEW_ALIGNMENT__>
99 using size_type = std::make_unsigned_t<difference_type>;
114 template <
class other_value_type>
129 throw std::bad_alloc();
132 #if defined(__APPLE__) && (!defined(_GLIBCXX_HAVE_ALIGNED_ALLOC) && !defined(_ISOC11_SOURCE)) 134 if (
int res = posix_memalign(&p, alignment, n *
sizeof(
value_type)); res == 0 && p !=
nullptr)
135 return static_cast<pointer>(p);
148 if (
auto p = static_cast<pointer>(std::aligned_alloc(alignment, n *
sizeof(
value_type))))
152 throw std::bad_alloc();
174 template<
typename new_value_type>
184 template <
class value_type2,
size_t alignment2>
188 return alignment == alignment2;
192 template <
class value_type2,
size_t alignment2>
195 return alignment != alignment2;
constexpr bool operator==(aligned_allocator< value_type2, alignment2 > const &) noexcept
Returns true if the memory-alignment matches.
Definition: aligned_allocator.hpp:186
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:58
void deallocate(pointer p, size_type) noexcept
Deallocates the storage referenced by the pointer p, which must be a pointer obtained by an earlier c...
Definition: aligned_allocator.hpp:165
static constexpr size_t alignment
The memory-alignment of the allocation.
Definition: aligned_allocator.hpp:90
std::make_unsigned_t< difference_type > size_type
The size type of the allocation.
Definition: aligned_allocator.hpp:99
constexpr bool operator!=(aligned_allocator< value_type2, alignment2 > const &) noexcept
Returns false if the memory-alignment mismatches.
Definition: aligned_allocator.hpp:193
typename std::pointer_traits< pointer >::difference_type difference_type
The difference type of the allocation.
Definition: aligned_allocator.hpp:97
The aligned_allocator member template class aligned_allocator::rebind provides a way to obtain an all...
Definition: aligned_allocator.hpp:175
pointer allocate(size_type n)
Allocates n * sizeof(T) bytes of uninitialized storage by calling std::aligned_alloc, but it is unspecified when and how this function is called.
Definition: aligned_allocator.hpp:125
value_t value_type
The value type of the allocation.
Definition: aligned_allocator.hpp:93
Allocates uninitialized storage whose memory-alignment is specified by alignment. ...
Definition: aligned_allocator.hpp:86
Provides C++20 additions to the type_traits header.
value_type * pointer
The pointer type of the allocation.
Definition: aligned_allocator.hpp:95
std::true_type is_always_equal
Are any two allocators of the same aligned_allocator type always compare equal?
Definition: aligned_allocator.hpp:102