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

#include <ordered_map.h>

Public Types

using key_type = typename ht::key_type
 
using mapped_type = T
 
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_map ()
 
 ordered_map (size_type bucket_count, const Hash &hash=Hash(), const KeyEqual &equal=KeyEqual(), const Allocator &alloc=Allocator())
 
 ordered_map (size_type bucket_count, const Allocator &alloc)
 
 ordered_map (size_type bucket_count, const Hash &hash, const Allocator &alloc)
 
 ordered_map (const Allocator &alloc)
 
template<class InputIt >
 ordered_map (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_map (InputIt first, InputIt last, size_type bucket_count, const Allocator &alloc)
 
template<class InputIt >
 ordered_map (InputIt first, InputIt last, size_type bucket_count, const Hash &hash, const Allocator &alloc)
 
 ordered_map (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_map (std::initializer_list< value_type > init, size_type bucket_count, const Allocator &alloc)
 
 ordered_map (std::initializer_list< value_type > init, size_type bucket_count, const Hash &hash, const Allocator &alloc)
 
ordered_mapoperator= (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)
 
template<class P , typename std::enable_if< std::is_constructible< value_type, P &&>::value >::type * = nullptr>
std::pair< iterator, bool > insert (P &&value)
 
std::pair< iterator, bool > insert (value_type &&value)
 
iterator insert (const_iterator hint, const value_type &value)
 
template<class P , typename std::enable_if< std::is_constructible< value_type, P &&>::value >::type * = nullptr>
iterator insert (const_iterator hint, P &&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 M >
std::pair< iterator, bool > insert_or_assign (const key_type &k, M &&obj)
 
template<class M >
std::pair< iterator, bool > insert_or_assign (key_type &&k, M &&obj)
 
template<class M >
iterator insert_or_assign (const_iterator hint, const key_type &k, M &&obj)
 
template<class M >
iterator insert_or_assign (const_iterator hint, key_type &&k, M &&obj)
 
template<class... Args>
std::pair< iterator, bool > emplace (Args &&... args)
 
template<class... Args>
iterator emplace_hint (const_iterator hint, Args &&... args)
 
template<class... Args>
std::pair< iterator, bool > try_emplace (const key_type &k, Args &&... args)
 
template<class... Args>
std::pair< iterator, bool > try_emplace (key_type &&k, Args &&... args)
 
template<class... Args>
iterator try_emplace (const_iterator hint, const key_type &k, Args &&... args)
 
template<class... Args>
iterator try_emplace (const_iterator hint, key_type &&k, 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_map &other)
 
T & at (const Key &key)
 
T & at (const Key &key, std::size_t precalculated_hash)
 
const T & at (const Key &key) const
 
const T & at (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>
T & at (const K &key)
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
T & at (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 T & at (const K &key) const
 
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
const T & at (const K &key, std::size_t precalculated_hash) const
 
T & operator[] (const Key &key)
 
T & operator[] (Key &&key)
 
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)
 
template<class... Args>
std::pair< iterator, bool > try_emplace_at_position (const_iterator pos, const key_type &k, Args &&... args)
 
template<class... Args>
std::pair< iterator, bool > try_emplace_at_position (const_iterator pos, key_type &&k, 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_map deserialize (Deserializer &deserializer, bool hash_compatible=false)
 

Friends

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

Detailed Description

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

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

The particularity of this hash map 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 map 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 and T must be copy constructible and/or move constructible. To use unordered_erase they both must be swappable.

The behaviour of the hash map is undefinded if the destructor of Key or T throws an exception.

By default the maximum size of a map 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::allocator_type = typename ht::allocator_type

◆ const_iterator

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

◆ const_pointer

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

◆ const_reference

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

◆ const_reverse_iterator

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

◆ difference_type

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

◆ hasher

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

◆ iterator

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

◆ key_equal

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

◆ key_type

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

◆ mapped_type

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
using tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::mapped_type = T

◆ pointer

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

◆ reference

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

◆ reverse_iterator

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

◆ size_type

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

◆ value_type

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

◆ values_container_type

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

Constructor & Destructor Documentation

◆ ordered_map() [1/11]

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

◆ ordered_map() [2/11]

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

◆ ordered_map() [3/11]

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

◆ ordered_map() [4/11]

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

◆ ordered_map() [5/11]

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

◆ ordered_map() [6/11]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class InputIt >
tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::ordered_map ( 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_map() [7/11]

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

◆ ordered_map() [8/11]

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

◆ ordered_map() [9/11]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::ordered_map ( 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_map() [10/11]

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

◆ ordered_map() [11/11]

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

Member Function Documentation

◆ at() [1/8]

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

◆ at() [2/8]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
T& tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::at ( 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.

◆ at() [3/8]

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

◆ at() [4/8]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
const T& tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::at ( 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.

◆ at() [5/8]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
T& tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::at ( 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.

◆ at() [6/8]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class K , class KE = KeyEqual, typename std::enable_if< has_is_transparent< KE >::value >::type * = nullptr>
T& tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::at ( 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.

◆ at() [7/8]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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 T& tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::at ( 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.

◆ at() [8/8]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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 T& tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::at ( 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.

◆ back()

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
const_reference tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::begin ( )
inlinenoexcept

◆ begin() [2/2]

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

◆ bucket_count()

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

◆ capacity()

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::capacity ( ) const
inlinenoexcept

◆ cbegin()

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

◆ cend()

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

◆ clear()

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

◆ count() [1/4]

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

◆ count() [2/4]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class Deserializer >
static ordered_map tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::deserialize ( Deserializer &  deserializer,
bool  hash_compatible = false 
)
inlinestatic

Deserialize a previouly serialized map 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 std::pair<Key, T> must be supported for U.

If the deserialized hash map type is hash compatible with the serialized map, 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 and T of the ordered_map are not the same as the types 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class... Args>
std::pair<iterator, bool> tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class... Args>
std::pair<iterator, bool> tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class... Args>
iterator tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
bool tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::empty ( ) const
inlinenoexcept

◆ end() [1/2]

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

◆ end() [2/2]

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

◆ equal_range() [1/8]

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

◆ equal_range() [2/8]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
std::pair<iterator, iterator> tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
std::pair<const_iterator, const_iterator> tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::equal_range ( const Key &  key) const
inline

◆ equal_range() [4/8]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
std::pair<const_iterator, const_iterator> tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::find ( const Key &  key)
inline

◆ find() [2/8]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
const_iterator tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::find ( const Key &  key) const
inline

◆ find() [4/8]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
const_iterator tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
const_reference tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
allocator_type tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::get_allocator ( ) const
inline

◆ hash_function()

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

◆ insert() [1/8]

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

◆ insert() [2/8]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class P , typename std::enable_if< std::is_constructible< value_type, P &&>::value >::type * = nullptr>
std::pair<iterator, bool> tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert ( P &&  value)
inline

◆ insert() [3/8]

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

◆ insert() [4/8]

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

◆ insert() [5/8]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class P , typename std::enable_if< std::is_constructible< value_type, P &&>::value >::type * = nullptr>
iterator tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert ( const_iterator  hint,
P &&  value 
)
inline

◆ insert() [6/8]

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

◆ insert() [7/8]

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

◆ insert() [8/8]

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

◆ insert_at_position() [1/2]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
std::pair<iterator, bool> tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
std::pair<iterator, bool> tsl::ordered_map< Key, T, 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().

◆ insert_or_assign() [1/4]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class M >
std::pair<iterator, bool> tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert_or_assign ( const key_type k,
M &&  obj 
)
inline

◆ insert_or_assign() [2/4]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class M >
std::pair<iterator, bool> tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert_or_assign ( key_type &&  k,
M &&  obj 
)
inline

◆ insert_or_assign() [3/4]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class M >
iterator tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert_or_assign ( const_iterator  hint,
const key_type k,
M &&  obj 
)
inline

◆ insert_or_assign() [4/4]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class M >
iterator tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::insert_or_assign ( const_iterator  hint,
key_type &&  k,
M &&  obj 
)
inline

◆ key_eq()

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

◆ load_factor()

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

◆ max_bucket_count()

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

◆ max_load_factor() [1/2]

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

◆ max_load_factor() [2/2]

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

◆ max_size()

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

◆ mutable_iterator()

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
const_iterator tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
ordered_map& tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::operator= ( std::initializer_list< value_type ilist)
inline

◆ operator[]() [1/2]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
T& tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::operator[] ( const Key &  key)
inline

◆ operator[]() [2/2]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
T& tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::operator[] ( Key &&  key)
inline

◆ pop_back()

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

◆ rbegin() [1/2]

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

◆ rbegin() [2/2]

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

◆ rcbegin()

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

◆ rcend()

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

◆ rehash()

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

◆ rend() [1/2]

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

◆ rend() [2/2]

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

◆ reserve()

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

◆ serialize()

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

Serialize the map through the serializer parameter.

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

  • template<typename U> void operator()(const U& value); where the types std::uint64_t, float and std::pair<Key, T> 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
void tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::shrink_to_fit ( )
inline

◆ size()

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

◆ swap()

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

◆ try_emplace() [1/4]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class... Args>
std::pair<iterator, bool> tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::try_emplace ( const key_type k,
Args &&...  args 
)
inline

◆ try_emplace() [2/4]

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

◆ try_emplace() [3/4]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class... Args>
iterator tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::try_emplace ( const_iterator  hint,
const key_type k,
Args &&...  args 
)
inline

◆ try_emplace() [4/4]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class... Args>
iterator tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::try_emplace ( const_iterator  hint,
key_type &&  k,
Args &&...  args 
)
inline

◆ try_emplace_at_position() [1/2]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class... Args>
std::pair<iterator, bool> tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::try_emplace_at_position ( const_iterator  pos,
const key_type k,
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().

◆ try_emplace_at_position() [2/2]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
template<class... Args>
std::pair<iterator, bool> tsl::ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType >::try_emplace_at_position ( const_iterator  pos,
key_type &&  k,
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().

◆ unordered_erase() [1/6]

template<class Key , class T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
iterator tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
size_type tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, 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_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
const values_container_type& tsl::ordered_map< Key, T, 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 T , class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>, class ValueTypeContainer = std::deque<std::pair<Key, T>, Allocator>, class IndexType = std::uint_least32_t>
bool operator!= ( const ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  lhs,
const ordered_map< Key, T, Hash, KeyEqual, Allocator, ValueTypeContainer, IndexType > &  rhs 
)
friend

◆ operator<

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

◆ operator<=

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

◆ operator==

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

◆ operator>

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

◆ operator>=

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

◆ swap

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

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