17 #ifndef __TBB_allocator_traits_H 18 #define __TBB_allocator_traits_H 20 #include "../tbb_stddef.h" 22 #if __TBB_ALLOCATOR_TRAITS_PRESENT 26 #if __TBB_CPP11_RVALUE_REF_PRESENT 31 #include __TBB_STD_SWAP_HEADER 38 #if __TBB_ALLOCATOR_TRAITS_PRESENT 48 template <
typename MyAlloc,
typename OtherAlloc>
50 my_allocator = other_allocator;
52 template <
typename MyAlloc,
typename OtherAlloc>
55 #if __TBB_CPP11_RVALUE_REF_PRESENT 56 template <
typename MyAlloc,
typename OtherAlloc>
60 my_allocator =
std::move(other_allocator);
62 template <
typename MyAlloc,
typename OtherAlloc>
68 template <
typename MyAlloc,
typename OtherAlloc>
69 inline void allocator_swap(MyAlloc& my_allocator, OtherAlloc& other_allocator, traits_true_type) {
71 swap(my_allocator, other_allocator);
73 template <
typename MyAlloc,
typename OtherAlloc>
76 #if __TBB_ALLOCATOR_TRAITS_PRESENT 77 using std::allocator_traits;
79 template<
typename Alloc>
93 typedef typename allocator_type::pointer
pointer;
96 typedef typename allocator_type::size_type
size_type;
99 typedef typename Alloc::template rebind<U>::other
other;
103 return a.allocate(n);
110 template<
typename PT>
112 ::new (static_cast<void*>(p)) PT();
115 template<
typename PT,
typename T1>
117 ::new (static_cast<void*>(p)) PT(tbb::internal::forward<T1>(t1));
120 template<
typename PT,
typename T1,
typename T2>
122 ::new (static_cast<void*>(p)) PT(tbb::internal::forward<T1>(t1), tbb::internal::forward<T2>(t2));
125 template<
typename PT,
typename T1,
typename T2,
typename T3>
128 ::new (static_cast<void*>(p)) PT(tbb::internal::forward<T1>(t1), tbb::internal::forward<T2>(t2),
129 tbb::internal::forward<T3>(t3));
140 #endif // __TBB_ALLOCATOR_TRAITS_PRESENT 144 template<
typename Alloc,
typename T>
146 #if __TBB_ALLOCATOR_TRAITS_PRESENT 155 #endif // __TBB_allocator_traits_H tbb::internal::false_type traits_false_type
tbb::internal::false_type propagate_on_container_swap
bool_constant< false > false_type
allocator_type::value_type value_type
static void construct(Alloc &, PT *p, __TBB_FORWARDING_REF(T1) t1)
allocator_traits< Alloc >::template rebind_alloc< T >::other type
static void construct(Alloc &, PT *p)
static void construct(Alloc &, PT *p, __TBB_FORWARDING_REF(T1) t1, __TBB_FORWARDING_REF(T2) t2, __TBB_FORWARDING_REF(T3) t3)
void allocator_swap(MyAlloc &my_allocator, OtherAlloc &other_allocator, traits_true_type)
tbb::internal::false_type propagate_on_container_copy_assignment
void suppress_unused_warning(const T1 &)
Utility template function to prevent "unused" warnings by various compilers.
static Alloc select_on_container_copy_construction(const Alloc &a)
void allocator_copy_assignment(MyAlloc &my_allocator, OtherAlloc &other_allocator, traits_true_type)
static pointer allocate(Alloc &a, size_type n)
allocator_type::size_type size_type
allocator_type::const_pointer const_pointer
tbb::internal::false_type propagate_on_container_move_assignment
void move(tbb_thread &t1, tbb_thread &t2)
static void deallocate(Alloc &a, pointer p, size_type n)
#define __TBB_FORWARDING_REF(A)
allocator_type::pointer pointer
Alloc::template rebind< U >::other other
static void construct(Alloc &, PT *p, __TBB_FORWARDING_REF(T1) t1, __TBB_FORWARDING_REF(T2) t2)
void allocator_move_assignment(MyAlloc &my_allocator, OtherAlloc &other_allocator, traits_true_type)
allocator_type::difference_type difference_type
static void destroy(Alloc &, T *p)
void const char const char int ITT_FORMAT __itt_group_sync p
tbb::internal::true_type traits_true_type
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type type
void swap(atomic< T > &lhs, atomic< T > &rhs)
bool_constant< true > true_type