Open 3D Engine AzCore API Reference  2305.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZStd::unordered_set< Key, Hasher, EqualKey, Allocator > Class Template Reference

#include <unordered_set.h>

Inherits AZStd::hash_table< Internal::UnorderedSetTableTraits< Key, Hasher, EqualKey, Allocator, false > >.

Public Types

using traits_type = typename base_type::traits_type
 
using key_type = typename base_type::key_type
 
using key_equal = typename base_type::key_equal
 
using hasher = typename base_type::hasher
 
using allocator_type = typename base_type::allocator_type
 
using size_type = typename base_type::size_type
 
using difference_type = typename base_type::difference_type
 
using pointer = typename base_type::pointer
 
using const_pointer = typename base_type::const_pointer
 
using reference = typename base_type::reference
 
using const_reference = typename base_type::const_reference
 
using iterator = typename base_type::iterator
 
using const_iterator = typename base_type::const_iterator
 
using value_type = typename base_type::value_type
 
using local_iterator = typename base_type::local_iterator
 
using const_local_iterator = typename base_type::const_local_iterator
 
using node_type = set_node_handle< set_node_traits< value_type, allocator_type, typename base_type::list_node_type, typename base_type::node_deleter >>
 
using insert_return_type = AssociativeInternal::insert_return_type< iterator, node_type >
 

Public Member Functions

 unordered_set (size_type numBuckets, const hasher &hash=hasher(), const key_equal &keyEqual=key_equal(), const allocator_type &alloc=allocator_type())
 
template<class Iterator >
 unordered_set (Iterator first, Iterator last, size_type numBuckets={}, const hasher &hash=hasher(), const key_equal &keyEqual=key_equal(), const allocator_type &alloc=allocator_type())
 
template<class R , class = enable_if_t<Internal::container_compatible_range<R, value_type>>>
 unordered_set (from_range_t, R &&rg, size_type numBucketsHint={}, const hasher &hash=hasher(), const key_equal &keyEqual=key_equal(), const allocator_type &alloc=allocator_type())
 
 unordered_set (const unordered_set &rhs)
 
 unordered_set (unordered_set &&rhs)
 
 unordered_set (const allocator_type &alloc)
 
 unordered_set (const unordered_set &rhs, const type_identity_t< allocator_type > &alloc)
 
 unordered_set (unordered_set &&rhs, const type_identity_t< allocator_type > &alloc)
 
 unordered_set (const initializer_list< value_type > &list, size_type numBuckets={}, const hasher &hash=hasher(), const key_equal &keyEqual=key_equal(), const allocator_type &alloc=allocator_type())
 
 unordered_set (size_type numBucketsHint, const allocator_type &alloc)
 
 unordered_set (size_type numBucketsHint, const hasher &hash, const allocator_type &alloc)
 
template<class InputIterator >
 unordered_set (InputIterator f, InputIterator l, size_type n, const allocator_type &a)
 
template<class InputIterator >
 unordered_set (InputIterator f, InputIterator l, size_type n, const hasher &hf, const allocator_type &a)
 
template<class R , class = enable_if_t<Internal::container_compatible_range<R, value_type>>>
 unordered_set (from_range_t, R &&rg, size_type n, const allocator_type &a)
 
template<class R , class = enable_if_t<Internal::container_compatible_range<R, value_type>>>
 unordered_set (from_range_t, R &&rg, size_type n, const hasher &hf, const allocator_type &a)
 
 unordered_set (initializer_list< value_type > il, size_type n, const allocator_type &a)
 
 unordered_set (initializer_list< value_type > il, size_type n, const hasher &hf, const allocator_type &a)
 
 unordered_set (const hasher &hash, const key_equal &keyEqual, const allocator_type &allocator)
 This constructor is AZStd extension (so we don't rehash/allocate memory)
 
this_typeoperator= (this_type &&rhs)
 
this_typeoperator= (const this_type &rhs)
 
insert_return_type insert (node_type &&nodeHandle)
 
iterator insert (const_iterator hint, node_type &&nodeHandle)
 
node_type extract (const key_type &key)
 
node_type extract (const_iterator it)
 

Detailed Description

template<class Key, class Hasher, class EqualKey, class Allocator>
class AZStd::unordered_set< Key, Hasher, EqualKey, Allocator >

Unordered set container is complaint with CTR1 (6.2.4.3) This is an associative container, all Keys are unique. insert function will return false, if you try to add key that is in the set. It has the extensions in the hash_table class.

Check the unordered_set AZStdExamples.

Note
By default we don't have reverse iterators for unordered_xxx containers. This saves us 4 bytes per node and it's not used in the majority of cases. Reverse iterators are supported via the last template parameter.

The documentation for this class was generated from the following files: