momo
3.10
|
momo::stdish::unordered_set
is similar to std::unordered_set
, but much more efficient in memory usage. The implementation is based on hash table with buckets in the form of small arrays.
More...
#include <unordered_set.h>
Public Types | |
typedef TKey | key_type |
typedef THashFunc | hasher |
typedef TEqualFunc | key_equal |
typedef TAllocator | allocator_type |
typedef HashSet | nested_container_type |
typedef size_t | size_type |
typedef ptrdiff_t | difference_type |
typedef key_type | value_type |
typedef HashSet::ConstIterator | const_iterator |
typedef HashSet::Iterator | iterator |
typedef value_type & | reference |
typedef const_iterator::Reference | const_reference |
typedef value_type * | pointer |
typedef const_iterator::Pointer | const_pointer |
typedef internal::set_node_handle< typename HashSet::ExtractedItem > | node_type |
typedef internal::insert_return_type< iterator, node_type > | insert_return_type |
typedef HashSet::ConstBucketBounds::Iterator | const_local_iterator |
typedef const_local_iterator | local_iterator |
Public Member Functions | |
unordered_set () | |
unordered_set (const allocator_type &alloc) | |
unordered_set (size_type bucketCount, const allocator_type &alloc=allocator_type()) | |
unordered_set (size_type bucketCount, const hasher &hashFunc, const allocator_type &alloc=allocator_type()) | |
unordered_set (size_type bucketCount, const hasher &hashFunc, const key_equal &equalFunc, const allocator_type &alloc=allocator_type()) | |
template<typename Iterator > | |
unordered_set (Iterator first, Iterator last) | |
template<typename Iterator > | |
unordered_set (Iterator first, Iterator last, size_type bucketCount, const allocator_type &alloc=allocator_type()) | |
template<typename Iterator > | |
unordered_set (Iterator first, Iterator last, size_type bucketCount, const hasher &hashFunc, const allocator_type &alloc=allocator_type()) | |
template<typename Iterator > | |
unordered_set (Iterator first, Iterator last, size_type bucketCount, const hasher &hashFunc, const key_equal &equalFunc, const allocator_type &alloc=allocator_type()) | |
unordered_set (std::initializer_list< momo::internal::Identity< value_type >> values) | |
unordered_set (std::initializer_list< momo::internal::Identity< value_type >> values, size_type bucketCount, const allocator_type &alloc=allocator_type()) | |
unordered_set (std::initializer_list< momo::internal::Identity< value_type >> values, size_type bucketCount, const hasher &hashFunc, const allocator_type &alloc=allocator_type()) | |
unordered_set (std::initializer_list< momo::internal::Identity< value_type >> values, size_type bucketCount, const hasher &hashFunc, const key_equal &equalFunc, const allocator_type &alloc=allocator_type()) | |
unordered_set (unordered_set &&right) noexcept | |
unordered_set (unordered_set &&right, const momo::internal::Identity< allocator_type > &alloc) noexcept(std::is_empty< allocator_type >::value) | |
unordered_set (const unordered_set &right) | |
unordered_set (const unordered_set &right, const momo::internal::Identity< allocator_type > &alloc) | |
~unordered_set ()=default | |
unordered_set & | operator= (unordered_set &&right) noexcept(std::is_empty< allocator_type >::value||std::allocator_traits< allocator_type >::propagate_on_container_move_assignment::value) |
unordered_set & | operator= (const unordered_set &right) |
unordered_set & | operator= (std::initializer_list< value_type > values) |
void | swap (unordered_set &right) noexcept |
const nested_container_type & | get_nested_container () const noexcept |
nested_container_type & | get_nested_container () noexcept |
const_iterator | begin () const noexcept |
const_iterator | end () const noexcept |
const_iterator | cbegin () const noexcept |
const_iterator | cend () const noexcept |
float | max_load_factor () const noexcept |
void | max_load_factor (float maxLoadFactor) |
hasher | hash_function () const |
key_equal | key_eq () const |
allocator_type | get_allocator () const noexcept |
size_type | max_size () const noexcept |
size_type | size () const noexcept |
MOMO_NODISCARD bool | empty () const noexcept |
void | clear () noexcept |
void | rehash (size_type bucketCount) |
void | reserve (size_type count) |
MOMO_FORCEINLINE const_iterator | find (const key_type &key) const |
template<typename KeyArg > | |
MOMO_FORCEINLINE momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, const_iterator > | find (const KeyArg &key) const |
MOMO_FORCEINLINE size_type | count (const key_type &key) const |
template<typename KeyArg > | |
MOMO_FORCEINLINE momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, size_type > | count (const KeyArg &key) const |
MOMO_FORCEINLINE bool | contains (const key_type &key) const |
template<typename KeyArg > | |
MOMO_FORCEINLINE momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, bool > | contains (const KeyArg &key) const |
MOMO_FORCEINLINE std::pair< const_iterator, const_iterator > | equal_range (const key_type &key) const |
template<typename KeyArg > | |
MOMO_FORCEINLINE momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, std::pair< const_iterator, const_iterator > > | equal_range (const KeyArg &key) const |
std::pair< iterator, bool > | insert (value_type &&value) |
iterator | insert (const_iterator hint, value_type &&value) |
std::pair< iterator, bool > | insert (const value_type &value) |
iterator | insert (const_iterator hint, const value_type &value) |
insert_return_type | insert (node_type &&node) |
iterator | insert (const_iterator hint, node_type &&node) |
template<typename Iterator > | |
void | insert (Iterator first, Iterator last) |
void | insert (std::initializer_list< value_type > values) |
template<typename... ValueArgs> | |
std::pair< iterator, bool > | emplace (ValueArgs &&... valueArgs) |
template<typename ValueArg > | |
momo::internal::EnableIf< std::is_same< key_type, typename std::decay< ValueArg >::type >::value, std::pair< iterator, bool > > | emplace (ValueArg &&valueArg) |
template<typename... ValueArgs> | |
iterator | emplace_hint (const_iterator hint, ValueArgs &&... valueArgs) |
iterator | erase (const_iterator where) |
iterator | erase (const_iterator first, const_iterator last) |
size_type | erase (const key_type &key) |
node_type | extract (const_iterator where) |
node_type | extract (const key_type &key) |
template<typename Set > | |
void | merge (Set &&set) |
size_type | max_bucket_count () const noexcept |
size_type | bucket_count () const noexcept |
size_type | bucket_size (size_type bucketIndex) const |
local_iterator | begin (size_type bucketIndex) |
const_local_iterator | begin (size_type bucketIndex) const |
local_iterator | end (size_type bucketIndex) |
const_local_iterator | end (size_type bucketIndex) const |
const_local_iterator | cbegin (size_type bucketIndex) const |
const_local_iterator | cend (size_type bucketIndex) const |
size_type | bucket (const key_type &key) const |
float | load_factor () const noexcept |
Friends | |
void | swap (unordered_set &left, unordered_set &right) noexcept |
template<typename ValueFilter > | |
size_type | erase_if (unordered_set &cont, const ValueFilter &valueFilter) |
bool | operator== (const unordered_set &left, const unordered_set &right) |
bool | operator!= (const unordered_set &left, const unordered_set &right) |
momo::stdish::unordered_set
is similar to std::unordered_set
, but much more efficient in memory usage. The implementation is based on hash table with buckets in the form of small arrays.
Deviations from the std::unordered_set
:
std::vector
.clear
, begin
, cbegin
and iterator increment take O(bucket_count) time in worst case.ObjectManager<key_type>::isNothrowAnywayAssignable
is false, functions erase
can throw exceptions.merge
, extract
and insert(node_type&&)
move items.It is allowed to pass to functions insert
and emplace
references to items within the container.
typedef TAllocator momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::allocator_type |
typedef HashSet::ConstIterator momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::const_iterator |
typedef HashSet::ConstBucketBounds::Iterator momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::const_local_iterator |
typedef const_iterator::Pointer momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::const_pointer |
typedef const_iterator::Reference momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::const_reference |
typedef ptrdiff_t momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::difference_type |
typedef THashFunc momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::hasher |
typedef internal::insert_return_type<iterator, node_type> momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::insert_return_type |
typedef HashSet::Iterator momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::iterator |
typedef TEqualFunc momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::key_equal |
typedef TKey momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::key_type |
typedef const_local_iterator momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::local_iterator |
typedef HashSet momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::nested_container_type |
typedef internal::set_node_handle<typename HashSet::ExtractedItem> momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::node_type |
typedef value_type* momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::pointer |
typedef value_type& momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::reference |
typedef size_t momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::size_type |
typedef key_type momo::stdish::unordered_set< TKey, THashFunc, TEqualFunc, TAllocator, THashSet >::value_type |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
default |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
friend |
|
friend |
|
friend |
|
friend |