24 #ifndef __TBB_concurrent_unordered_set_H 25 #define __TBB_concurrent_unordered_set_H 33 namespace interface5 {
36 template<
typename Key,
typename Hash_compare,
typename Allocator,
bool Allow_multimapping>
57 template <
typename Key,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
typename Allocator = tbb::tbb_allocator<Key> >
58 class concurrent_unordered_set :
public internal::concurrent_unordered_base< concurrent_unordered_set_traits<Key, internal::hash_compare<Key, Hasher, Key_equality>, Allocator, false> >
61 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
63 typedef internal::concurrent_unordered_base< traits_type >
base_type;
67 using traits_type::allow_multimapping;
69 using base_type::insert;
80 typedef typename base_type::pointer
pointer;
94 explicit concurrent_unordered_set(size_type n_of_buckets = base_type::initial_bucket_number,
const hasher& a_hasher = hasher(),
95 const key_equal& a_keyeq = key_equal(),
const allocator_type& a =
allocator_type())
96 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
100 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
104 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
110 template <
typename Iterator>
112 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
const allocator_type& a =
allocator_type())
113 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
118 template <
typename Iterator>
120 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
125 template <
typename Iterator>
127 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
132 #if __TBB_INITIALIZER_LISTS_PRESENT 133 concurrent_unordered_set(std::initializer_list<value_type> il, size_type n_of_buckets = base_type::initial_bucket_number,
const hasher& a_hasher = hasher(),
135 const key_equal& a_keyeq = key_equal(),
const allocator_type& a =
allocator_type())
136 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
138 insert(il.begin(),il.end());
142 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
144 insert(il.begin(), il.end());
147 concurrent_unordered_set(std::initializer_list<value_type> il, size_type n_of_buckets,
const hasher& a_hasher,
const allocator_type& a)
148 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
150 insert(il.begin(), il.end());
153 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 155 #if __TBB_CPP11_RVALUE_REF_PRESENT 156 #if !__TBB_IMPLICIT_MOVE_PRESENT 161 concurrent_unordered_set& operator=(
const concurrent_unordered_set& table)
163 return static_cast<concurrent_unordered_set&
>(base_type::operator=(table));
166 concurrent_unordered_set(concurrent_unordered_set&& table)
170 concurrent_unordered_set& operator=(concurrent_unordered_set&& table)
172 return static_cast<concurrent_unordered_set&
>(base_type::operator=(
std::move(table)));
177 : base_type(
std::
move(table), a)
179 #endif //__TBB_CPP11_RVALUE_REF_PRESENT 182 : base_type(table, a)
187 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 192 template <
template<
typename...>
typename Set,
typename T,
typename... Args>
193 using cu_set_t = Set <
195 std::conditional_t< (
sizeof...(Args)>0) && !is_allocator_v< pack_element_t<0, Args...> >,
197 std::conditional_t< (
sizeof...(Args)>1) && !is_allocator_v< pack_element_t<1, Args...> >,
198 pack_element_t<1, Args...>, std::equal_to<T> >,
199 std::conditional_t< (
sizeof...(Args)>0) && is_allocator_v< pack_element_t<
sizeof...(Args)-1, Args...> >,
207 -> internal::cu_set_t<concurrent_unordered_set, internal::iterator_value_t<I>>;
210 template<
typename I,
typename... Args>
212 -> internal::cu_set_t<concurrent_unordered_set, internal::iterator_value_t<I>, Args...>;
217 -> internal::cu_set_t<concurrent_unordered_set, T>;
220 template<
typename T,
typename... Args>
226 template <
typename Key,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
227 typename Allocator = tbb::tbb_allocator<Key> >
229 public internal::concurrent_unordered_base< concurrent_unordered_set_traits<Key,
230 internal::hash_compare<Key, Hasher, Key_equality>, Allocator, true> >
233 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
235 typedef internal::concurrent_unordered_base< traits_type >
base_type;
236 #if __TBB_EXTRA_DEBUG 239 using traits_type::allow_multimapping;
241 using base_type::insert;
267 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
269 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
273 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
277 const allocator_type& a)
278 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
284 template <
typename Iterator>
286 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
288 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
293 template <
typename Iterator>
295 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
300 template <
typename Iterator>
302 const allocator_type& a)
303 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
308 #if __TBB_INITIALIZER_LISTS_PRESENT 311 const hasher& a_hasher = hasher(),
const key_equal& a_keyeq = key_equal(),
const allocator_type& a =
allocator_type())
312 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
314 insert(il.begin(),il.end());
318 : base_type(n_of_buckets, key_compare(hasher(), key_equal()), a)
320 insert(il.begin(), il.end());
324 const allocator_type& a)
325 : base_type(n_of_buckets, key_compare(a_hasher, key_equal()), a)
327 insert(il.begin(), il.end());
330 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 332 #if __TBB_CPP11_RVALUE_REF_PRESENT 333 #if !__TBB_IMPLICIT_MOVE_PRESENT 338 concurrent_unordered_multiset& operator=(
const concurrent_unordered_multiset& table)
340 return static_cast<concurrent_unordered_multiset&
>(base_type::operator=(table));
343 concurrent_unordered_multiset(concurrent_unordered_multiset&& table)
347 concurrent_unordered_multiset& operator=(concurrent_unordered_multiset&& table)
349 return static_cast<concurrent_unordered_multiset&
>(base_type::operator=(
std::move(table)));
354 : base_type(
std::
move(table), a)
357 #endif //__TBB_CPP11_RVALUE_REF_PRESENT 360 : base_type(table, a)
364 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 369 -> internal::cu_set_t<concurrent_unordered_multiset, internal::iterator_value_t<I>>;
372 template<
typename I,
typename... Args>
374 -> internal::cu_set_t<concurrent_unordered_multiset, internal::iterator_value_t<I>, Args...>;
379 -> internal::cu_set_t<concurrent_unordered_multiset, T>;
382 template<
typename T,
typename... Args>
394 #endif// __TBB_concurrent_unordered_set_H tbb::internal::allocator_rebind< Allocator, value_type >::type allocator_type
concurrent_unordered_set(Iterator first, Iterator last, size_type n_of_buckets=base_type::initial_bucket_number, const hasher &a_hasher=hasher(), const key_equal &a_keyeq=key_equal(), const allocator_type &a=allocator_type())
base_type::size_type size_type
internal::hash_compare< Key, Hasher, Key_equality > hash_compare
concurrent_unordered_set_traits(const hash_compare &hc)
base_type::const_reference const_reference
concurrent_unordered_multiset(const concurrent_unordered_multiset &table, const Allocator &a)
base_type::iterator iterator
concurrent_unordered_multiset(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::reference reference
base_type::iterator iterator
static const Key & get_key(const value_type &value)
base_type::const_pointer const_pointer
concurrent_unordered_set(Iterator first, Iterator last, size_type n_of_buckets, const allocator_type &a)
base_type::pointer pointer
auto first(Container &c) -> decltype(begin(c))
base_type::size_type size_type
concurrent_unordered_set(const Allocator &a)
internal::concurrent_unordered_base< traits_type > base_type
concurrent_unordered_set(size_type n_of_buckets=base_type::initial_bucket_number, const hasher &a_hasher=hasher(), const key_equal &a_keyeq=key_equal(), const allocator_type &a=allocator_type())
base_type::iterator local_iterator
concurrent_unordered_set_traits< Key, hash_compare, Allocator, false > traits_type
concurrent_unordered_multiset(const Allocator &a)
concurrent_unordered_multiset(concurrent_unordered_multiset &&table, const Allocator &a)
__TBB_IMPLICIT_MOVE_PRESENT
concurrent_unordered_set(size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
auto last(Container &c) -> decltype(begin(c))
base_type::const_iterator const_iterator
Hash_compare hash_compare
base_type::value_type value_type
concurrent_unordered_set(concurrent_unordered_set &&table, const Allocator &a)
__TBB_IMPLICIT_MOVE_PRESENT
base_type::const_reference const_reference
base_type::difference_type difference_type
base_type::pointer pointer
base_type::difference_type difference_type
concurrent_unordered_set(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
concurrent_unordered_multiset(Iterator first, Iterator last, size_type n_of_buckets, const allocator_type &a)
base_type::const_pointer const_pointer
concurrent_unordered_set_traits< Key, hash_compare, Allocator, true > traits_type
concurrent_unordered_multiset(size_type n_of_buckets=base_type::initial_bucket_number, const hasher &a_hasher=hasher(), const key_equal &a_keyeq=key_equal(), const allocator_type &a=allocator_type())
concurrent_unordered_set_traits()
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 value
concurrent_unordered_set(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
concurrent_unordered_multiset(size_type n_of_buckets, const allocator_type &a)
base_type::allocator_type allocator_type
base_type::value_type value_type
allocator_traits< Alloc >::template rebind_alloc< T >::other type
void move(tbb_thread &t1, tbb_thread &t2)
internal::hash_compare< Key, Hasher, Key_equality > hash_compare
concurrent_unordered_multiset(size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::const_iterator const_local_iterator
base_type::allocator_type allocator_type
concurrent_unordered_multiset(Iterator first, Iterator last, size_type n_of_buckets=base_type::initial_bucket_number, const hasher &a_hasher=hasher(), const key_equal &a_keyeq=key_equal(), const allocator_type &a=allocator_type())
base_type::const_iterator const_iterator
concurrent_unordered_multiset(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
concurrent_unordered_set(const concurrent_unordered_set &table, const Allocator &a)
Identifiers declared inside namespace internal should never be used directly by client code...
concurrent_unordered_multiset(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
concurrent_unordered_set(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
concurrent_unordered_set(size_type n_of_buckets, const allocator_type &a)
base_type::reference reference
base_type::const_iterator const_local_iterator
internal::concurrent_unordered_base< traits_type > base_type
base_type::iterator local_iterator
hash_compare my_hash_compare
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.