ordered-map
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > Class Template Reference

#include <ordered_set.h>

Public Types

using key_type = typename ht::key_type
 
using value_type = typename ht::value_type
 
using size_type = typename ht::size_type
 
using difference_type = typename ht::difference_type
 
using hasher = typename ht::hasher
 
using key_equal = typename ht::key_equal
 
using allocator_type = typename ht::allocator_type
 
using reference = typename ht::reference
 
using const_reference = typename ht::const_reference
 
using pointer = typename ht::pointer
 
using const_pointer = typename ht::const_pointer
 
using iterator = typename ht::iterator
 
using const_iterator = typename ht::const_iterator
 
using reverse_iterator = typename ht::reverse_iterator
 
using const_reverse_iterator = typename ht::const_reverse_iterator
 
using values_container_type = typename ht::values_container_type
 

Public Member Functions

 ordered_set ()
 
 ordered_set (size_type bucket_count, const Hash &hash=Hash(), const KeyEqual &equal=KeyEqual(), const Allocator &alloc=Allocator())
 
 ordered_set (size_type bucket_count, const Allocator &alloc)
 
 ordered_set (size_type bucket_count, const Hash &hash, const Allocator &alloc)
 
 ordered_set (const Allocator &alloc)
 
template<class InputIt >
 ordered_set (InputIt first, InputIt last, size_type bucket_count=ht::DEFAULT_INIT_BUCKETS_SIZE, const Hash &hash=Hash(), const KeyEqual &equal=KeyEqual(), const Allocator &alloc=Allocator())
 
template<class InputIt >
 ordered_set (InputIt first, InputIt last, size_type bucket_count, const Allocator &alloc)
 
template<class InputIt >
 ordered_set (InputIt first, InputIt last, size_type bucket_count, const Hash &hash, const Allocator &alloc)
 
 ordered_set (std::initializer_list< value_type > init, size_type bucket_count=ht::DEFAULT_INIT_BUCKETS_SIZE, const Hash &hash=Hash(), const KeyEqual &equal=KeyEqual(), const Allocator &alloc=Allocator())
 
 ordered_set (std::initializer_list< value_type > init, size_type bucket_count, const Allocator &alloc)
 
 ordered_set (std::initializer_list< value_type > init, size_type bucket_count, const Hash &hash, const Allocator &alloc)
 
ordered_setoperator= (std::initializer_list< value_type > ilist)
 
allocator_type get_allocator () const
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
const_iterator cbegin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cend () const noexcept
 
reverse_iterator rbegin () noexcept
 
const_reverse_iterator rbegin () const noexcept
 
const_reverse_iterator rcbegin () const noexcept
 
reverse_iterator rend () noexcept
 
const_reverse_iterator rend () const noexcept
 
const_reverse_iterator rcend () const noexcept
 
bool empty () const noexcept
 
size_type size () const noexcept
 
size_type max_size () const noexcept
 
void clear () noexcept
 
std::pair< iterator, bool > insert (const value_type &value)
 
std::pair< iterator, bool > insert (value_type &&value)
 
iterator insert (const_iterator hint, const value_type &value)
 
iterator insert (const_iterator hint, value_type &&value)
 
template<class InputIt >
void insert (InputIt first, InputIt last)
 
void insert (std::initializer_list< value_type > ilist)
 
template<class... Args>
std::pair< iterator, bool > emplace (Args &&... args)
 
template<class... Args>
iterator emplace_hint (const_iterator hint, Args &&... args)
 
iterator erase (iterator pos)
 
iterator erase (const_iterator pos)
 
iterator erase (const_iterator first, const_iterator last)
 
size_type erase (const key_type &key)
 
size_type erase (const key_type &key, std::size_t precalculated_hash)
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
size_type erase (const K &key)
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
size_type erase (const K &key, std::size_t precalculated_hash)
 
void swap (ordered_set &other)
 
size_type count (const Key &key) const
 
size_type count (const Key &key, std::size_t precalculated_hash) const
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
size_type count (const K &key) const
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
size_type count (const K &key, std::size_t precalculated_hash) const
 
iterator find (const Key &key)
 
iterator find (const Key &key, std::size_t precalculated_hash)
 
const_iterator find (const Key &key) const
 
const_iterator find (const Key &key, std::size_t precalculated_hash) const
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
iterator find (const K &key)
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
iterator find (const K &key, std::size_t precalculated_hash)
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
const_iterator find (const K &key) const
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
const_iterator find (const K &key, std::size_t precalculated_hash) const
 
std::pair< iterator, iteratorequal_range (const Key &key)
 
std::pair< iterator, iteratorequal_range (const Key &key, std::size_t precalculated_hash)
 
std::pair< const_iterator, const_iteratorequal_range (const Key &key) const
 
std::pair< const_iterator, const_iteratorequal_range (const Key &key, std::size_t precalculated_hash) const
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
std::pair< iterator, iteratorequal_range (const K &key)
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
std::pair< iterator, iteratorequal_range (const K &key, std::size_t precalculated_hash)
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
std::pair< const_iterator, const_iteratorequal_range (const K &key) const
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
std::pair< const_iterator, const_iteratorequal_range (const K &key, std::size_t precalculated_hash) const
 
size_type bucket_count () const
 
size_type max_bucket_count () const
 
float load_factor () const
 
float max_load_factor () const
 
void max_load_factor (float ml)
 
void rehash (size_type count)
 
void reserve (size_type count)
 
hasher hash_function () const
 
key_equal key_eq () const
 
iterator mutable_iterator (const_iterator pos)
 
iterator nth (size_type index)
 
const_iterator nth (size_type index) const
 
const_reference front () const
 
const_reference back () const
 
template<class U = values_container_type, typename std::enable_if< tsl::detail_ordered_hash::is_vector< U >::value >::type * = nullptr>
const values_container_type::value_type * data () const noexcept
 
const values_container_typevalues_container () const noexcept
 
template<class U = values_container_type, typename std::enable_if< tsl::detail_ordered_hash::is_vector< U >::value >::type * = nullptr>
size_type capacity () const noexcept
 
void shrink_to_fit ()
 
std::pair< iterator, bool > insert_at_position (const_iterator pos, const value_type &value)
 
std::pair< iterator, bool > insert_at_position (const_iterator pos, value_type &&value)
 
template<class... Args>
std::pair< iterator, bool > emplace_at_position (const_iterator pos, Args &&... args)
 
void pop_back ()
 
iterator unordered_erase (iterator pos)
 
iterator unordered_erase (const_iterator pos)
 
size_type unordered_erase (const key_type &key)
 
size_type unordered_erase (const key_type &key, std::size_t precalculated_hash)
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
size_type unordered_erase (const K &key)
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
size_type unordered_erase (const K &key, std::size_t precalculated_hash)
 
template<class Serializer >
void serialize (Serializer &serializer) const
 

Static Public Member Functions

template<class Deserializer >
static ordered_set deserialize (Deserializer &deserializer, bool hash_compatible=false)
 

Friends

bool operator== (const ordered_set &lhs, const ordered_set &rhs)
 
bool operator!= (const ordered_set &lhs, const ordered_set &rhs)
 
bool operator< (const ordered_set &lhs, const ordered_set &rhs)
 
bool operator<= (const ordered_set &lhs, const ordered_set &rhs)
 
bool operator> (const ordered_set &lhs, const ordered_set &rhs)
 
bool operator>= (const ordered_set &lhs, const ordered_set &rhs)
 
void swap (ordered_set &lhs, ordered_set &rhs)
 

Detailed Description

template<class Key, class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
class tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >

Implementation of an hash set using open adressing with robin hood with backshift delete to resolve collisions.

The particularity of this hash set is that it remembers the order in which the elements were added and provide a way to access the structure which stores these values through the 'values_container()' method. The used container is defined by ValueTypeContainer, by default a std::deque is used (grows faster) but a std::vector may be used. In this case the set provides a 'data()' method which give a direct access to the memory used to store the values (which can be usefull to communicate with C API's).

The Key must be copy constructible and/or move constructible. To use unordered_erase it also must be swappable.

The behaviour of the hash set is undefinded if the destructor of Key throws an exception.

By default the maximum size of a set is limited to 2^32 - 1 values, if needed this can be changed through the IndexType template parameter. Using an uint64_t will raise this limit to 2^64 - 1 values but each bucket will use 16 bytes instead of 8 bytes in addition to the space needed to store the values.

Iterators invalidation:

Member Typedef Documentation

◆ allocator_type

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::allocator_type = typename ht::allocator_type

◆ const_iterator

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::const_iterator = typename ht::const_iterator

◆ const_pointer

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::const_pointer = typename ht::const_pointer

◆ const_reference

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::const_reference = typename ht::const_reference

◆ const_reverse_iterator

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::const_reverse_iterator = typename ht::const_reverse_iterator

◆ difference_type

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::difference_type = typename ht::difference_type

◆ hasher

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::hasher = typename ht::hasher

◆ iterator

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::iterator = typename ht::iterator

◆ key_equal

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::key_equal = typename ht::key_equal

◆ key_type

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::key_type = typename ht::key_type

◆ pointer

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::pointer = typename ht::pointer

◆ reference

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::reference = typename ht::reference

◆ reverse_iterator

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::reverse_iterator = typename ht::reverse_iterator

◆ size_type

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::size_type = typename ht::size_type

◆ value_type

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::value_type = typename ht::value_type

◆ values_container_type

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::values_container_type = typename ht::values_container_type

Constructor & Destructor Documentation

◆ ordered_set() [1/11]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::ordered_set ( )
inline

◆ ordered_set() [2/11]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::ordered_set ( size_type  bucket_count,
const Hash &  hash = Hash(),
const KeyEqual &  equal = KeyEqual(),
const Allocator &  alloc = Allocator() 
)
inlineexplicit

◆ ordered_set() [3/11]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::ordered_set ( size_type  bucket_count,
const Allocator &  alloc 
)
inline

◆ ordered_set() [4/11]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::ordered_set ( size_type  bucket_count,
const Hash &  hash,
const Allocator &  alloc 
)
inline

◆ ordered_set() [5/11]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::ordered_set ( const Allocator &  alloc)
inlineexplicit

◆ ordered_set() [6/11]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class InputIt >
tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::ordered_set ( InputIt  first,
InputIt  last,
size_type  bucket_count = ht::DEFAULT_INIT_BUCKETS_SIZE,
const Hash &  hash = Hash(),
const KeyEqual &  equal = KeyEqual(),
const Allocator &  alloc = Allocator() 
)
inline

◆ ordered_set() [7/11]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class InputIt >
tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::ordered_set ( InputIt  first,
InputIt  last,
size_type  bucket_count,
const Allocator &  alloc 
)
inline

◆ ordered_set() [8/11]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class InputIt >
tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::ordered_set ( InputIt  first,
InputIt  last,
size_type  bucket_count,
const Hash &  hash,
const Allocator &  alloc 
)
inline

◆ ordered_set() [9/11]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::ordered_set ( std::initializer_list< value_type init,
size_type  bucket_count = ht::DEFAULT_INIT_BUCKETS_SIZE,
const Hash &  hash = Hash(),
const KeyEqual &  equal = KeyEqual(),
const Allocator &  alloc = Allocator() 
)
inline

◆ ordered_set() [10/11]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::ordered_set ( std::initializer_list< value_type init,
size_type  bucket_count,
const Allocator &  alloc 
)
inline

◆ ordered_set() [11/11]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::ordered_set ( std::initializer_list< value_type init,
size_type  bucket_count,
const Hash &  hash,
const Allocator &  alloc 
)
inline

Member Function Documentation

◆ back()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const_reference tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::back ( ) const
inline

Return const_reference to the last element. Requires the container to not be empty.

◆ begin() [1/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::begin ( )
inlinenoexcept

◆ begin() [2/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::begin ( ) const
inlinenoexcept

◆ bucket_count()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::bucket_count ( ) const
inline

◆ capacity()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class U = values_container_type, typename std::enable_if< tsl::detail_ordered_hash::is_vector< U >::value >::type * = nullptr>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::capacity ( ) const
inlinenoexcept

◆ cbegin()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::cbegin ( ) const
inlinenoexcept

◆ cend()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::cend ( ) const
inlinenoexcept

◆ clear()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
void tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::clear ( )
inlinenoexcept

◆ count() [1/4]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::count ( const Key &  key) const
inline

◆ count() [2/4]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::count ( const Key &  key,
std::size_t  precalculated_hash 
) const
inline

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup if you already have the hash.

◆ count() [3/4]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::count ( const K &  key) const
inline

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

◆ count() [4/4]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::count ( const K &  key,
std::size_t  precalculated_hash 
) const
inline

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup if you already have the hash.

◆ data()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class U = values_container_type, typename std::enable_if< tsl::detail_ordered_hash::is_vector< U >::value >::type * = nullptr>
const values_container_type::value_type* tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::data ( ) const
inlinenoexcept

Only available if ValueTypeContainer is a std::vector. Same as calling 'values_container().data()'.

◆ deserialize()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class Deserializer >
static ordered_set tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::deserialize ( Deserializer &  deserializer,
bool  hash_compatible = false 
)
inlinestatic

Deserialize a previouly serialized set through the deserializer parameter.

The deserializer parameter must be a function object that supports the following calls:

  • template<typename U> U operator()(); where the types std::uint64_t, float and Key must be supported for U.

If the deserialized hash set type is hash compatible with the serialized set, the deserialization process can be sped up by setting hash_compatible to true. To be hash compatible, the Hash and KeyEqual must behave the same way than the ones used on the serialized map. The std::size_t must also be of the same size as the one on the platform used to serialize the map, the same apply for IndexType. If these criteria are not met, the behaviour is undefined with hash_compatible sets to true.

The behaviour is undefined if the type Key of the ordered_set is not the same as the type used during serialization.

The implementation leaves binary compatibilty (endianness, IEEE 754 for floats, size of int, ...) of the types it deserializes in the hands of the Deserializer function object if compatibilty is required.

◆ emplace()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class... Args>
std::pair<iterator, bool> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::emplace ( Args &&...  args)
inline

Due to the way elements are stored, emplace will need to move or copy the key-value once. The method is equivalent to insert(value_type(std::forward<Args>(args)...));

Mainly here for compatibility with the std::unordered_map interface.

◆ emplace_at_position()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class... Args>
std::pair<iterator, bool> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::emplace_at_position ( const_iterator  pos,
Args &&...  args 
)
inline

Insert the value before pos shifting all the elements on the right of pos (including pos) one position to the right.

Amortized linear time-complexity in the distance between pos and end().

Same as insert_at_position(pos, value_type(std::forward<Args>(args)...), mainly here for coherence.

◆ emplace_hint()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class... Args>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::emplace_hint ( const_iterator  hint,
Args &&...  args 
)
inline

Due to the way elements are stored, emplace_hint will need to move or copy the key-value once. The method is equivalent to insert(hint, value_type(std::forward<Args>(args)...));

Mainly here for compatibility with the std::unordered_map interface.

◆ empty()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
bool tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::empty ( ) const
inlinenoexcept

◆ end() [1/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::end ( )
inlinenoexcept

◆ end() [2/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::end ( ) const
inlinenoexcept

◆ equal_range() [1/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
std::pair<iterator, iterator> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::equal_range ( const Key &  key)
inline

◆ equal_range() [2/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
std::pair<iterator, iterator> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::equal_range ( const Key &  key,
std::size_t  precalculated_hash 
)
inline

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup if you already have the hash.

◆ equal_range() [3/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
std::pair<const_iterator, const_iterator> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::equal_range ( const Key &  key) const
inline

◆ equal_range() [4/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
std::pair<const_iterator, const_iterator> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::equal_range ( const Key &  key,
std::size_t  precalculated_hash 
) const
inline

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup if you already have the hash.

◆ equal_range() [5/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
std::pair<iterator, iterator> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::equal_range ( const K &  key)
inline

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

◆ equal_range() [6/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
std::pair<iterator, iterator> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::equal_range ( const K &  key,
std::size_t  precalculated_hash 
)
inline

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup if you already have the hash.

◆ equal_range() [7/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
std::pair<const_iterator, const_iterator> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::equal_range ( const K &  key) const
inline

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

◆ equal_range() [8/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
std::pair<const_iterator, const_iterator> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::equal_range ( const K &  key,
std::size_t  precalculated_hash 
) const
inline

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup if you already have the hash.

◆ erase() [1/7]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::erase ( iterator  pos)
inline

When erasing an element, the insert order will be preserved and no holes will be present in the container returned by 'values_container()'.

The method is in O(n), if the order is not important 'unordered_erase(...)' method is faster with an O(1) average complexity.

◆ erase() [2/7]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::erase ( const_iterator  pos)
inline

When erasing an element, the insert order will be preserved and no holes will be present in the container returned by 'values_container()'.

The method is in O(n), if the order is not important 'unordered_erase(...)' method is faster with an O(1) average complexity.

◆ erase() [3/7]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::erase ( const_iterator  first,
const_iterator  last 
)
inline

When erasing an element, the insert order will be preserved and no holes will be present in the container returned by 'values_container()'.

The method is in O(n), if the order is not important 'unordered_erase(...)' method is faster with an O(1) average complexity.

◆ erase() [4/7]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::erase ( const key_type key)
inline

When erasing an element, the insert order will be preserved and no holes will be present in the container returned by 'values_container()'.

The method is in O(n), if the order is not important 'unordered_erase(...)' method is faster with an O(1) average complexity.

◆ erase() [5/7]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::erase ( const key_type key,
std::size_t  precalculated_hash 
)
inline

When erasing an element, the insert order will be preserved and no holes will be present in the container returned by 'values_container()'.

The method is in O(n), if the order is not important 'unordered_erase(...)' method is faster with an O(1) average complexity.

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup to the value if you already have the hash.

◆ erase() [6/7]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::erase ( const K &  key)
inline

When erasing an element, the insert order will be preserved and no holes will be present in the container returned by 'values_container()'.

The method is in O(n), if the order is not important 'unordered_erase(...)' method is faster with an O(1) average complexity.

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

◆ erase() [7/7]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::erase ( const K &  key,
std::size_t  precalculated_hash 
)
inline

When erasing an element, the insert order will be preserved and no holes will be present in the container returned by 'values_container()'.

The method is in O(n), if the order is not important 'unordered_erase(...)' method is faster with an O(1) average complexity.

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup to the value if you already have the hash.

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

◆ find() [1/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::find ( const Key &  key)
inline

◆ find() [2/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::find ( const Key &  key,
std::size_t  precalculated_hash 
)
inline

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup if you already have the hash.

◆ find() [3/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::find ( const Key &  key) const
inline

◆ find() [4/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::find ( const Key &  key,
std::size_t  precalculated_hash 
) const
inline

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup if you already have the hash.

◆ find() [5/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::find ( const K &  key)
inline

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

◆ find() [6/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::find ( const K &  key,
std::size_t  precalculated_hash 
)
inline

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup if you already have the hash.

◆ find() [7/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
const_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::find ( const K &  key) const
inline

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

◆ find() [8/8]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
const_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::find ( const K &  key,
std::size_t  precalculated_hash 
) const
inline

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup if you already have the hash.

◆ front()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const_reference tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::front ( ) const
inline

Return const_reference to the first element. Requires the container to not be empty.

◆ get_allocator()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
allocator_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::get_allocator ( ) const
inline

◆ hash_function()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
hasher tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::hash_function ( ) const
inline

◆ insert() [1/6]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
std::pair<iterator, bool> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert ( const value_type value)
inline

◆ insert() [2/6]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
std::pair<iterator, bool> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert ( value_type &&  value)
inline

◆ insert() [3/6]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert ( const_iterator  hint,
const value_type value 
)
inline

◆ insert() [4/6]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert ( const_iterator  hint,
value_type &&  value 
)
inline

◆ insert() [5/6]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class InputIt >
void tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert ( InputIt  first,
InputIt  last 
)
inline

◆ insert() [6/6]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
void tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert ( std::initializer_list< value_type ilist)
inline

◆ insert_at_position() [1/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
std::pair<iterator, bool> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert_at_position ( const_iterator  pos,
const value_type value 
)
inline

Insert the value before pos shifting all the elements on the right of pos (including pos) one position to the right.

Amortized linear time-complexity in the distance between pos and end().

◆ insert_at_position() [2/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
std::pair<iterator, bool> tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert_at_position ( const_iterator  pos,
value_type &&  value 
)
inline

Insert the value before pos shifting all the elements on the right of pos (including pos) one position to the right.

Amortized linear time-complexity in the distance between pos and end().

◆ key_eq()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
key_equal tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::key_eq ( ) const
inline

◆ load_factor()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
float tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::load_factor ( ) const
inline

◆ max_bucket_count()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::max_bucket_count ( ) const
inline

◆ max_load_factor() [1/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
float tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::max_load_factor ( ) const
inline

◆ max_load_factor() [2/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
void tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::max_load_factor ( float  ml)
inline

◆ max_size()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::max_size ( ) const
inlinenoexcept

◆ mutable_iterator()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::mutable_iterator ( const_iterator  pos)
inline

Convert a const_iterator to an iterator.

◆ nth() [1/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::nth ( size_type  index)
inline

Requires index <= size().

Return an iterator to the element at index. Return end() if index == size().

◆ nth() [2/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::nth ( size_type  index) const
inline

Requires index <= size().

Return an iterator to the element at index. Return end() if index == size().

◆ operator=()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
ordered_set& tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::operator= ( std::initializer_list< value_type ilist)
inline

◆ pop_back()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
void tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::pop_back ( )
inline

◆ rbegin() [1/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
reverse_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::rbegin ( )
inlinenoexcept

◆ rbegin() [2/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const_reverse_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::rbegin ( ) const
inlinenoexcept

◆ rcbegin()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const_reverse_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::rcbegin ( ) const
inlinenoexcept

◆ rcend()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const_reverse_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::rcend ( ) const
inlinenoexcept

◆ rehash()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
void tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::rehash ( size_type  count)
inline

◆ rend() [1/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
reverse_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::rend ( )
inlinenoexcept

◆ rend() [2/2]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const_reverse_iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::rend ( ) const
inlinenoexcept

◆ reserve()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
void tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::reserve ( size_type  count)
inline

◆ serialize()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class Serializer >
void tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::serialize ( Serializer &  serializer) const
inline

Serialize the set through the serializer parameter.

The serializer parameter must be a function object that supports the following call:

  • void operator()(const U& value); where the types std::uint64_t, float and Key must be supported for U.

The implementation leaves binary compatibilty (endianness, IEEE 754 for floats, ...) of the types it serializes in the hands of the Serializer function object if compatibilty is required.

◆ shrink_to_fit()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
void tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::shrink_to_fit ( )
inline

◆ size()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::size ( ) const
inlinenoexcept

◆ swap()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
void tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::swap ( ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  other)
inline

◆ unordered_erase() [1/6]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::unordered_erase ( iterator  pos)
inline

Faster erase operation with an O(1) average complexity but it doesn't preserve the insertion order.

If an erasure occurs, the last element of the map will take the place of the erased element.

◆ unordered_erase() [2/6]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::unordered_erase ( const_iterator  pos)
inline

Faster erase operation with an O(1) average complexity but it doesn't preserve the insertion order.

If an erasure occurs, the last element of the map will take the place of the erased element.

◆ unordered_erase() [3/6]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::unordered_erase ( const key_type key)
inline

Faster erase operation with an O(1) average complexity but it doesn't preserve the insertion order.

If an erasure occurs, the last element of the map will take the place of the erased element.

◆ unordered_erase() [4/6]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::unordered_erase ( const key_type key,
std::size_t  precalculated_hash 
)
inline

Faster erase operation with an O(1) average complexity but it doesn't preserve the insertion order.

If an erasure occurs, the last element of the map will take the place of the erased element.

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup if you already have the hash.

◆ unordered_erase() [5/6]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::unordered_erase ( const K &  key)
inline

Faster erase operation with an O(1) average complexity but it doesn't preserve the insertion order.

If an erasure occurs, the last element of the map will take the place of the erased element.

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

◆ unordered_erase() [6/6]

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
size_type tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::unordered_erase ( const K &  key,
std::size_t  precalculated_hash 
)
inline

Faster erase operation with an O(1) average complexity but it doesn't preserve the insertion order.

If an erasure occurs, the last element of the map will take the place of the erased element.

This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. If so, K must be hashable and comparable to Key.

Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same as hash_function()(key). Usefull to speed-up the lookup if you already have the hash.

◆ values_container()

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
const values_container_type& tsl::ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::values_container ( ) const
inlinenoexcept

Return the container in which the values are stored. The values are in the same order as the insertion order and are contiguous in the structure, no holes (size() == values_container().size()).

Friends And Related Function Documentation

◆ operator!=

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
bool operator!= ( const ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  lhs,
const ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  rhs 
)
friend

◆ operator<

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
bool operator< ( const ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  lhs,
const ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  rhs 
)
friend

◆ operator<=

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
bool operator<= ( const ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  lhs,
const ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  rhs 
)
friend

◆ operator==

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
bool operator== ( const ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  lhs,
const ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  rhs 
)
friend

◆ operator>

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
bool operator> ( const ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  lhs,
const ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  rhs 
)
friend

◆ operator>=

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
bool operator>= ( const ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  lhs,
const ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  rhs 
)
friend

◆ swap

template<class Key , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>, class ValueTypeContainer = std::deque<Key, Allocator>, class IndexType = std::uint_least32_t>
void swap ( ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  lhs,
ordered_set< Key, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  rhs 
)
friend

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