2 Copyright 2018 Glen Joseph Fernandes
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
8 #include <boost/align/aligned_allocator_adaptor.hpp>
15 typedef std::size_t size_type
;
16 typedef std::ptrdiff_t difference_type
;
28 : state_(other
.state()) { }
30 T
* allocate(std::size_t size
, const void* = 0) {
31 return static_cast<T
*>(::operator new(sizeof(T
) * size
));
34 void deallocate(T
* ptr
, std::size_t) {
35 ::operator delete(ptr
);
46 template<class T
, class U
>
48 operator==(const A
<T
>& a
, const A
<U
>& b
)
50 return a
.state() == b
.state();
53 template<class T
, class U
>
55 operator!=(const A
<T
>& a
, const A
<U
>& b
)
65 boost::alignment::aligned_allocator_adaptor
<A
<S
> > a(A
<S
>(1));
71 boost::alignment::aligned_allocator_adaptor
<A
<V
> > a(A
<V
>(1));
72 boost::alignment::aligned_allocator_adaptor
<A
<V
> >::rebind
<S
>::other
r(a
);