1 #ifndef _LV_ALIGNED_ALLOCATOR_HPP
2 #define _LV_ALIGNED_ALLOCATOR_HPP
7 #include <libvisual/lv_mem.h>
11 template <
typename T, std::
size_t alignment>
14 template <std::
size_t alignment>
17 typedef void value_type;
18 typedef void* pointer;
19 typedef void const* const_pointer;
32 template <
typename T, std::
size_t alignment>
37 typedef T
const* const_pointer;
38 typedef T
const& const_reference;
40 typedef std::size_t size_type;
41 typedef std::ptrdiff_t difference_type;
53 pointer address (reference x)
const
58 const_pointer address (const_reference x)
const
63 pointer allocate (size_type n,
typename AlignedAllocator<void, alignment>::pointer =
nullptr)
68 throw std::bad_alloc ();
73 void deallocate (pointer ptr, size_type) noexcept
78 size_type max_size ()
const
80 return size_type (-1) /
sizeof (T);
83 void construct (pointer p, const_reference x)
88 void destroy (pointer p)
94 template <
typename T,
typename U, std::
size_t alignment>
95 bool operator== (AlignedAllocator<T, alignment>
const&, AlignedAllocator<U, alignment>
const&)
100 template <
typename T,
typename U, std::
size_t alignment>
101 bool operator!= (AlignedAllocator<T, alignment>
const&, AlignedAllocator<U, alignment>
const&)
108 #endif // LV_ALIGNED_ALLOCATOR_HPP