24 #ifndef __TBB_concurrent_unordered_set_H 25 #define __TBB_concurrent_unordered_set_H 32 namespace interface5 {
35 template<
typename Key,
typename Hash_compare,
typename Allocator,
bool Allow_multimapping>
43 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 44 typedef internal::node_handle<Key, Key, allocator_type>
node_type;
45 #endif // __TBB_UNORDERED_NODE_HANDLE_PRESENT 59 template<
typename Key,
typename Hasher,
typename Key_equality,
typename Allocator>
62 template <
typename Key,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
typename Allocator = tbb::tbb_allocator<Key> >
63 class concurrent_unordered_set :
public internal::concurrent_unordered_base< concurrent_unordered_set_traits<Key, internal::hash_compare<Key, Hasher, Key_equality>, Allocator, false> >
66 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
68 typedef internal::concurrent_unordered_base< traits_type >
base_type;
74 using base_type::insert;
85 typedef typename base_type::pointer
pointer;
97 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 118 template <
typename Iterator>
126 template <
typename Iterator>
133 template <
typename Iterator>
140 #if __TBB_INITIALIZER_LISTS_PRESENT 146 insert(il.begin(),il.end());
152 insert(il.begin(), il.end());
158 insert(il.begin(), il.end());
161 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 163 #if __TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 170 return static_cast<concurrent_unordered_set&>(base_type::operator=(table));
179 return static_cast<concurrent_unordered_set&>(base_type::operator=(
std::move(table)));
181 #endif //__TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 183 #if __TBB_CPP11_RVALUE_REF_PRESENT 189 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 190 template<
typename Hash,
typename Equality>
194 template<
typename Hash,
typename Equality>
198 template<
typename Hash,
typename Equality>
202 template<
typename Hash,
typename Equality>
206 #endif //__TBB_UNORDERED_NODE_HANDLE_PRESENT 214 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 219 template <
template<
typename...>
typename Set,
typename T,
typename... Args>
220 using cu_set_t = Set <
222 std::conditional_t< (
sizeof...(Args)>0) && !is_allocator_v< pack_element_t<0, Args...> >,
224 std::conditional_t< (
sizeof...(Args)>1) && !is_allocator_v< pack_element_t<1, Args...> >,
225 pack_element_t<1, Args...>, std::equal_to<T> >,
226 std::conditional_t< (
sizeof...(Args)>0) && is_allocator_v< pack_element_t<
sizeof...(Args)-1, Args...> >,
233 concurrent_unordered_set(I, I)
234 -> internal::cu_set_t<concurrent_unordered_set, internal::iterator_value_t<I>>;
237 template<
typename I,
typename... Args>
238 concurrent_unordered_set(I, I,
size_t, Args...)
239 -> internal::cu_set_t<concurrent_unordered_set, internal::iterator_value_t<I>, Args...>;
243 concurrent_unordered_set(std::initializer_list<T>)
244 -> internal::cu_set_t<concurrent_unordered_set, T>;
247 template<
typename T,
typename... Args>
248 concurrent_unordered_set(std::initializer_list<T>,
size_t, Args...)
249 -> internal::cu_set_t<concurrent_unordered_set, T, Args...>;
253 template <
typename Key,
typename Hasher = tbb::tbb_hash<Key>,
typename Key_equality = std::equal_to<Key>,
254 typename Allocator = tbb::tbb_allocator<Key> >
255 class concurrent_unordered_multiset :
256 public internal::concurrent_unordered_base< concurrent_unordered_set_traits<Key,
257 internal::hash_compare<Key, Hasher, Key_equality>, Allocator, true> >
260 typedef internal::hash_compare<Key, Hasher, Key_equality>
hash_compare;
262 typedef internal::concurrent_unordered_base< traits_type >
base_type;
263 #if __TBB_EXTRA_DEBUG 266 using traits_type::allow_multimapping;
268 using base_type::insert;
291 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 293 #endif // __TBB_UNORDERED_NODE_HANDLE_PRESENT 314 template <
typename Iterator>
323 template <
typename Iterator>
330 template <
typename Iterator>
338 #if __TBB_INITIALIZER_LISTS_PRESENT 342 : base_type(n_of_buckets, key_compare(a_hasher, a_keyeq), a)
344 insert(il.begin(),il.end());
350 insert(il.begin(), il.end());
357 insert(il.begin(), il.end());
360 #endif //# __TBB_INITIALIZER_LISTS_PRESENT 363 #if __TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 370 return static_cast<concurrent_unordered_multiset&>(base_type::operator=(table));
373 concurrent_unordered_multiset(concurrent_unordered_multiset&& table)
374 : base_type(std::
move(table))
377 concurrent_unordered_multiset& operator=(concurrent_unordered_multiset&& table)
379 return static_cast<concurrent_unordered_multiset&>(base_type::operator=(
std::move(table)));
381 #endif //__TBB_CPP11_RVALUE_REF_PRESENT && !__TBB_IMPLICIT_MOVE_PRESENT 383 #if __TBB_CPP11_RVALUE_REF_PRESENT 390 #if __TBB_UNORDERED_NODE_HANDLE_PRESENT 391 template<
typename Hash,
typename Equality>
393 { this->internal_merge(source); }
395 template<
typename Hash,
typename Equality>
397 { this->internal_merge(source); }
399 template<
typename Hash,
typename Equality>
401 { this->internal_merge(source); }
403 template<
typename Hash,
typename Equality>
405 { this->internal_merge(source); }
407 #endif //__TBB_UNORDERED_NODE_HANDLE_PRESENT 414 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 419 -> internal::cu_set_t<concurrent_unordered_multiset, internal::iterator_value_t<I>>;
422 template<
typename I,
typename... Args>
424 -> internal::cu_set_t<concurrent_unordered_multiset, internal::iterator_value_t<I>, Args...>;
429 -> internal::cu_set_t<concurrent_unordered_multiset, T>;
432 template<
typename T,
typename... Args>
439 using interface5::concurrent_unordered_set;
440 using interface5::concurrent_unordered_multiset;
444 #endif// __TBB_concurrent_unordered_set_H internal::hash_compare< Key, Hasher, Key_equality > hash_compare
base_type::reference reference
concurrent_unordered_multiset(const Allocator &a)
concurrent_unordered_set(size_type n_of_buckets, const allocator_type &a)
base_type::const_pointer const_pointer
internal::hash_compare< Key, Hasher, Key_equality > hash_compare
base_type::value_type value_type
base_type::const_reference const_reference
concurrent_unordered_multiset(const concurrent_unordered_multiset &table, const Allocator &a)
base_type::iterator iterator
base_type::const_iterator const_local_iterator
void merge(concurrent_unordered_multiset< Key, Hash, Equality, Allocator > &source)
concurrent_unordered_base & operator=(const concurrent_unordered_base &right)
base_type::pointer pointer
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_set(Iterator first, Iterator last, size_type n_of_buckets, const allocator_type &a)
auto first(Container &c) -> decltype(begin(c))
concurrent_unordered_set(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
base_type::difference_type difference_type
concurrent_unordered_set_traits< Key, hash_compare, Allocator, true > traits_type
concurrent_unordered_set_traits(const hash_compare &hc)
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
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())
void merge(concurrent_unordered_set< Key, Hash, Equality, Allocator > &&source)
allocator_traits< Alloc >::template rebind_alloc< T >::other type
void internal_merge(SourceType &source)
void merge(concurrent_unordered_multiset< Key, Hash, Equality, Allocator > &&source)
base_type::difference_type difference_type
concurrent_unordered_multiset(concurrent_unordered_multiset &&table, const Allocator &a)
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())
static const Key & get_key(const value_type &value)
void merge(concurrent_unordered_set< Key, Hash, Equality, Allocator > &source)
base_type::size_type size_type
concurrent_unordered_set(concurrent_unordered_set &&table, const Allocator &a)
concurrent_unordered_set(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
concurrent_unordered_set_traits()
base_type::size_type size_type
auto last(Container &c) -> decltype(begin(c))
base_type::allocator_type allocator_type
base_type::iterator local_iterator
base_type::const_pointer const_pointer
concurrent_unordered_set_traits< Key, hash_compare, Allocator, false > traits_type
base_type::const_reference const_reference
concurrent_unordered_set(const Allocator &a)
concurrent_unordered_multiset(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
concurrent_unordered_multiset(size_type n_of_buckets, const allocator_type &a)
base_type::node_type node_type
base_type::reference reference
base_type::const_iterator const_local_iterator
base_type::iterator local_iterator
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
Hash_compare hash_compare
concurrent_unordered_multiset(size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
concurrent_unordered_set(std::initializer_list< value_type > il, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
base_type::value_type value_type
base_type::iterator iterator
void move(tbb_thread &t1, tbb_thread &t2)
internal::node_handle< Key, Key, allocator_type > node_type
void merge(concurrent_unordered_multiset< Key, Hash, Equality, Allocator > &&source)
internal::concurrent_unordered_base< traits_type > base_type
std::pair< iterator, bool > insert(const value_type &value)
concurrent_unordered_multiset(Iterator first, Iterator last, size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
void merge(concurrent_unordered_set< Key, Hash, Equality, Allocator > &source)
hash_compare my_hash_compare
void merge(concurrent_unordered_multiset< Key, Hash, Equality, Allocator > &source)
static const size_type initial_bucket_number
tbb::internal::allocator_rebind< Allocator, value_type >::type allocator_type
base_type::node_type node_type
internal::concurrent_unordered_base< traits_type > base_type
void merge(concurrent_unordered_set< Key, Hash, Equality, Allocator > &&source)
concurrent_unordered_set(size_type n_of_buckets, const hasher &a_hasher, const allocator_type &a)
Class for determining type of std::allocator<T>::value_type.
Identifiers declared inside namespace internal should never be used directly by client code.
concurrent_unordered_multiset(Iterator first, Iterator last, size_type n_of_buckets, const allocator_type &a)
concurrent_unordered_multiset(std::initializer_list< value_type > il, size_type n_of_buckets, const allocator_type &a)
base_type::const_iterator const_iterator
base_type::pointer pointer
concurrent_unordered_set(const concurrent_unordered_set &table, const Allocator &a)
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())