Go to the documentation of this file.
9 #ifndef BOOST_SMART_PTR_DETAIL_ARRAY_ALLOCATOR_HPP
10 #define BOOST_SMART_PTR_DETAIL_ARRAY_ALLOCATOR_HPP
43 template<
class T, std::
size_t N>
61 template<
class A,
class T,
class R>
64 template<
class A_,
class T_,
class R_>
67 #if !defined(BOOST_NO_CXX11_ALLOCATOR)
68 typedef std::allocator_traits<A>
AT;
69 typedef typename AT::template rebind_alloc<char>
CA;
70 typedef typename AT::template rebind_traits<char>
CT;
78 #if !defined(BOOST_NO_CXX11_ALLOCATOR)
88 typedef typename A::pointer
pointer;
92 typedef typename A::reference reference;
93 typedef typename A::const_reference const_reference;
100 #if !defined(BOOST_NO_CXX11_ALLOCATOR)
133 std::size_t n2 =
data.size *
sizeof(
type);
134 std::size_t n3 = n2 + M;
136 void* p1 = ca.allocate(n1 + n3);
137 void* p2 =
static_cast<char*
>(p1) + n1;
139 *
data.result =
static_cast<type*
>(p2);
148 std::size_t n2 =
data.size *
sizeof(
type) + M;
149 char* p1 =
reinterpret_cast<char*
>(memory);
151 ca.deallocate(p1, n1 + n2);
155 return static_cast<const A&
>(*this);
159 return static_cast<A&
>(*this);
163 data.object = memory;
175 #if !defined(BOOST_NO_CXX11_ALLOCATOR)
189 template<
class A1,
class A2,
class T,
class R>
195 template<
class A1,
class A2,
class T,
class R>
201 template<
class T,
class Y =
char>
204 template<
class T,
class Y>
206 template<
class T_,
class Y_>
230 :
data(size, result) {
242 std::size_t n1 = count *
sizeof(Y);
243 std::size_t n2 =
data.size *
sizeof(
type);
244 std::size_t n3 = n2 + M;
245 void* p1 = ::operator
new(n1 + n3);
246 void* p2 =
static_cast<char*
>(p1) + n1;
248 *
data.result =
static_cast<type*
>(p2);
249 return static_cast<Y*
>(p1);
254 ::operator
delete(p1);
257 #if defined(BOOST_NO_CXX11_ALLOCATOR)
268 N =
static_cast<std::size_t
>(-1) /
sizeof(Y)
285 data.object = memory;
298 template<
class T,
class Y1,
class Y2>
304 template<
class T,
class Y1,
class Y2>
AT::void_pointer void_pointer
std::allocator_traits< A > AT
as_allocator(const as_allocator< U, T, R > &other)
as_allocator(const A &allocator_, std::size_t size, type **result)
bool operator==(const as_allocator< A1, T, R > &a1, const as_allocator< A2, T, R > &a2)
void operator()(const void *)
ms_allocator(type **result)
bool operator!=(const as_allocator< A1, T, R > &a1, const as_allocator< A2, T, R > &a2)
as_allocator< typename AT::template rebind_alloc< U >, T, R > other
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
array_base< T >::type type
ms_allocator_state< T > data
const A & allocator() const
void * align(std::size_t alignment, std::size_t size, void *&ptr, std::size_t &space)
array_base< T >::type type
AT::const_pointer const_pointer
AT::value_type value_type
ms_allocator(const ms_allocator< T, U > &other)
void release(ms_noinit_tag)
const typedef Y * const_pointer
ms_allocator_state(type **result_)
ms_allocator_state(std::size_t size_, type **result_)
boost_foreach_argument_dependent_lookup_hack tag
void ms_destroy(T *, std::size_t, ms_is_trivial)
boost::remove_cv< T >::type type
AT::template rebind_alloc< char > CA
AT::difference_type difference_type
ms_allocator_state< T > data
AT::template rebind_traits< char > CT
void construct(void *p, const Type &t)
void release(ms_init_tag)
std::ptrdiff_t difference_type
void deallocate(pointer memory, size_type count)
void as_destroy(const A &allocator, T *memory, std::size_t size)
AT::const_void_pointer const_void_pointer
pointer allocate(size_type count, const void *=0)
void deallocate(pointer memory, size_type)
as_allocator(const A &allocator_, type **result)
array_base< T >::type type
pointer allocate(size_type count, const_void_pointer=0)
ms_allocator(std::size_t size, type **result)
void destroy(const Type *p)
ms_allocator< T, U > other
array_base< T >::type type
const typedef Y & const_reference
sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:36:32