Maipa's Standard Library Extension 1.5.6
mstd
Loading...
Searching...
No Matches
mstd::ordered_map< Key, T > Class Template Reference

#include <ordered_map.hpp>

Collaboration diagram for mstd::ordered_map< Key, T >:
[legend]

Public Types

using key_type = remove_cvref_t<Key>
using mapped_type = remove_cvref_t<T>
using value_type = std::pair<key_type, mapped_type>
using reference = value_type&
using const_reference = const value_type&
using size_type = _MSTD_TYPENAME17 _data_type::size_type
using difference_type = _MSTD_TYPENAME17 _data_type::difference_type
using iterator = _MSTD_TYPENAME17 _data_type::iterator
using const_iterator = _MSTD_TYPENAME17 _data_type::const_iterator
using reverse_iterator = _MSTD_TYPENAME17 _data_type::reverse_iterator
using const_reverse_iterator = _MSTD_TYPENAME17 _data_type::const_reverse_iterator

Public Member Functions

_MSTD_CONSTEXPR20 ordered_map ()=default
_MSTD_CONSTEXPR20 ordered_map (const ordered_map &other)=default
_MSTD_CONSTEXPR20 ordered_map (ordered_map &&other) noexcept=default
_MSTD_CONSTEXPR20 ordered_map (std::initializer_list< value_type > init)
template<mstd::iterator_of< value_type > Iter>
_MSTD_CONSTEXPR20 ordered_map (Iter begin, Iter end)
_MSTD_CONSTEXPR20 ~ordered_map ()=default
_MSTD_CONSTEXPR20 ordered_mapoperator= (const ordered_map &other)=default
_MSTD_CONSTEXPR20 ordered_mapoperator= (ordered_map &&other) noexcept=default
_MSTD_CONSTEXPR20 mapped_typeemplace (const_iterator where, const key_type &key, const mapped_type &value)
_MSTD_CONSTEXPR20 mapped_typeemplace (const_iterator where, key_type &&key, mapped_type &&value)
_MSTD_CONSTEXPR20 mapped_typeemplace_back (const key_type &key, const mapped_type &value)
_MSTD_CONSTEXPR20 mapped_typeemplace_back (key_type &&key, mapped_type &&value)
_MSTD_CONSTEXPR20 mapped_typeinsert (const_iterator where, const value_type &value)
_MSTD_CONSTEXPR20 mapped_typeinsert (const_iterator where, value_type &&value)
template<mstd::iterator_of< value_type > Iter>
_MSTD_CONSTEXPR20 void insert (const_iterator where, Iter begin, Iter end)
_MSTD_CONSTEXPR20 void insert (const_iterator where, std::initializer_list< value_type > init)
_MSTD_CONSTEXPR20 mapped_typeinsert_back (const value_type &value)
_MSTD_CONSTEXPR20 mapped_typeinsert_back (value_type &&value)
template<mstd::iterator_of< value_type > Iter>
_MSTD_CONSTEXPR20 void insert_back (Iter begin, Iter end)
_MSTD_CONSTEXPR20 void insert_back (std::initializer_list< value_type > init)
_MSTD_CONSTEXPR20 void erase (const key_type &key)
_MSTD_CONSTEXPR20 void erase (key_type &&key)
_MSTD_CONSTEXPR20 mapped_typeat (const key_type &key)
_MSTD_CONSTEXPR20 mapped_typeat (key_type &&key)
_MSTD_CONSTEXPR20 const mapped_typeat (const key_type &key) const
_MSTD_CONSTEXPR20 const mapped_typeat (key_type &&key) const
_MSTD_CONSTEXPR20 size_type size () const
_MSTD_CONSTEXPR20 bool empty () const
_MSTD_CONSTEXPR20 bool contains (const key_type &key) const
_MSTD_CONSTEXPR20 bool contains (key_type &&key) const
_MSTD_CONSTEXPR20 iterator find (const key_type &key)
_MSTD_CONSTEXPR20 iterator find (key_type &&key)
_MSTD_CONSTEXPR20 const_iterator find (const key_type &key) const
_MSTD_CONSTEXPR20 const_iterator find (key_type &&key) const
_MSTD_CONSTEXPR20 void clear ()
_MSTD_CONSTEXPR20 iterator begin ()
_MSTD_CONSTEXPR20 iterator end ()
_MSTD_CONSTEXPR20 const_iterator begin () const
_MSTD_CONSTEXPR20 const_iterator end () const
_MSTD_CONSTEXPR20 const_iterator cbegin () const
_MSTD_CONSTEXPR20 const_iterator cend () const
_MSTD_CONSTEXPR20 reverse_iterator rbegin ()
_MSTD_CONSTEXPR20 reverse_iterator rend ()
_MSTD_CONSTEXPR20 const_reverse_iterator rbegin () const
_MSTD_CONSTEXPR20 const_reverse_iterator rend () const
_MSTD_CONSTEXPR20 const_reverse_iterator crbegin () const
_MSTD_CONSTEXPR20 const_reverse_iterator crend () const
_MSTD_CONSTEXPR20 mapped_typeoperator[] (const key_type &key)
_MSTD_CONSTEXPR20 mapped_typeoperator[] (key_type &&key)
_MSTD_CONSTEXPR20 const mapped_typeoperator[] (const key_type &key) const
_MSTD_CONSTEXPR20 const mapped_typeoperator[] (key_type &&key) const
_MSTD_CONSTEXPR20 bool operator== (const ordered_map &other) const
_MSTD_CONSTEXPR20 bool operator!= (const ordered_map &other) const

Private Types

using _data_type = std::vector<value_type>
using _map_type = std::unordered_map<key_type, size_type>

Private Member Functions

_MSTD_CONSTEXPR20 void _update_indexes (const size_type from)
template<class UK, class U>
_MSTD_CONSTEXPR20 mapped_type_emplace (const_iterator where, UK &&key, U &&value)
template<class UK, class U>
_MSTD_CONSTEXPR20 mapped_type_emplace_back (UK &&key, U &&value)
template<class U>
_MSTD_CONSTEXPR20 mapped_type_insert (const_iterator where, U &&value)
template<class U>
_MSTD_CONSTEXPR20 mapped_type_insert_back (U &&value)
template<class UK>
_MSTD_CONSTEXPR20 void _erase (UK &&key)
template<class UK>
_MSTD_CONSTEXPR20 mapped_type_at (UK &&key)
template<class UK>
_MSTD_CONSTEXPR20 const mapped_type_at (UK &&key) const
template<class UK>
_MSTD_CONSTEXPR20 bool _contains (UK &&key) const
template<class UK>
_MSTD_CONSTEXPR20 iterator _find (UK &&key)
template<class UK>
_MSTD_CONSTEXPR20 const_iterator _find (UK &&key) const
template<class UK>
_MSTD_CONSTEXPR20 mapped_type_at_with_construct (UK &&key)

Private Attributes

_data_type _orderedElements
_map_type _elementsMap

Member Typedef Documentation

◆ _data_type

template<class Key, class T>
using mstd::ordered_map< Key, T >::_data_type = std::vector<value_type>
private

◆ _map_type

template<class Key, class T>
using mstd::ordered_map< Key, T >::_map_type = std::unordered_map<key_type, size_type>
private

◆ const_iterator

template<class Key, class T>
using mstd::ordered_map< Key, T >::const_iterator = _MSTD_TYPENAME17 _data_type::const_iterator

◆ const_reference

template<class Key, class T>
using mstd::ordered_map< Key, T >::const_reference = const value_type&

◆ const_reverse_iterator

template<class Key, class T>
using mstd::ordered_map< Key, T >::const_reverse_iterator = _MSTD_TYPENAME17 _data_type::const_reverse_iterator

◆ difference_type

template<class Key, class T>
using mstd::ordered_map< Key, T >::difference_type = _MSTD_TYPENAME17 _data_type::difference_type

◆ iterator

template<class Key, class T>
using mstd::ordered_map< Key, T >::iterator = _MSTD_TYPENAME17 _data_type::iterator

◆ key_type

template<class Key, class T>
using mstd::ordered_map< Key, T >::key_type = remove_cvref_t<Key>

◆ mapped_type

template<class Key, class T>
using mstd::ordered_map< Key, T >::mapped_type = remove_cvref_t<T>

◆ reference

template<class Key, class T>
using mstd::ordered_map< Key, T >::reference = value_type&

◆ reverse_iterator

template<class Key, class T>
using mstd::ordered_map< Key, T >::reverse_iterator = _MSTD_TYPENAME17 _data_type::reverse_iterator

◆ size_type

template<class Key, class T>
using mstd::ordered_map< Key, T >::size_type = _MSTD_TYPENAME17 _data_type::size_type

◆ value_type

template<class Key, class T>
using mstd::ordered_map< Key, T >::value_type = std::pair<key_type, mapped_type>

Constructor & Destructor Documentation

◆ ordered_map() [1/5]

template<class Key, class T>
_MSTD_CONSTEXPR20 mstd::ordered_map< Key, T >::ordered_map ( )
default

◆ ordered_map() [2/5]

template<class Key, class T>
_MSTD_CONSTEXPR20 mstd::ordered_map< Key, T >::ordered_map ( const ordered_map< Key, T > & other)
default

◆ ordered_map() [3/5]

template<class Key, class T>
_MSTD_CONSTEXPR20 mstd::ordered_map< Key, T >::ordered_map ( ordered_map< Key, T > && other)
defaultnoexcept

◆ ordered_map() [4/5]

template<class Key, class T>
_MSTD_CONSTEXPR20 mstd::ordered_map< Key, T >::ordered_map ( std::initializer_list< value_type > init)
inline

◆ ordered_map() [5/5]

template<class Key, class T>
template<mstd::iterator_of< value_type > Iter>
_MSTD_CONSTEXPR20 mstd::ordered_map< Key, T >::ordered_map ( Iter begin,
Iter end )
inline

◆ ~ordered_map()

template<class Key, class T>
_MSTD_CONSTEXPR20 mstd::ordered_map< Key, T >::~ordered_map ( )
default

Member Function Documentation

◆ _at() [1/2]

template<class Key, class T>
template<class UK>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::_at ( UK && key)
inlinenodiscardprivate

◆ _at() [2/2]

template<class Key, class T>
template<class UK>
_MSTD_CONSTEXPR20 const mapped_type & mstd::ordered_map< Key, T >::_at ( UK && key) const
inlinenodiscardprivate

◆ _at_with_construct()

template<class Key, class T>
template<class UK>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::_at_with_construct ( UK && key)
inlinenodiscardprivate

◆ _contains()

template<class Key, class T>
template<class UK>
_MSTD_CONSTEXPR20 bool mstd::ordered_map< Key, T >::_contains ( UK && key) const
inlinenodiscardprivate

◆ _emplace()

template<class Key, class T>
template<class UK, class U>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::_emplace ( const_iterator where,
UK && key,
U && value )
inlineprivate

◆ _emplace_back()

template<class Key, class T>
template<class UK, class U>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::_emplace_back ( UK && key,
U && value )
inlineprivate

◆ _erase()

template<class Key, class T>
template<class UK>
_MSTD_CONSTEXPR20 void mstd::ordered_map< Key, T >::_erase ( UK && key)
inlineprivate

◆ _find() [1/2]

template<class Key, class T>
template<class UK>
_MSTD_CONSTEXPR20 iterator mstd::ordered_map< Key, T >::_find ( UK && key)
inlinenodiscardprivate

◆ _find() [2/2]

template<class Key, class T>
template<class UK>
_MSTD_CONSTEXPR20 const_iterator mstd::ordered_map< Key, T >::_find ( UK && key) const
inlinenodiscardprivate

◆ _insert()

template<class Key, class T>
template<class U>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::_insert ( const_iterator where,
U && value )
inlineprivate

◆ _insert_back()

template<class Key, class T>
template<class U>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::_insert_back ( U && value)
inlineprivate

◆ _update_indexes()

template<class Key, class T>
_MSTD_CONSTEXPR20 void mstd::ordered_map< Key, T >::_update_indexes ( const size_type from)
inlineprivate

◆ at() [1/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::at ( const key_type & key)
inlinenodiscard

◆ at() [2/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 const mapped_type & mstd::ordered_map< Key, T >::at ( const key_type & key) const
inlinenodiscard

◆ at() [3/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::at ( key_type && key)
inlinenodiscard

◆ at() [4/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 const mapped_type & mstd::ordered_map< Key, T >::at ( key_type && key) const
inlinenodiscard

◆ begin() [1/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 iterator mstd::ordered_map< Key, T >::begin ( )
inlinenodiscard

◆ begin() [2/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 const_iterator mstd::ordered_map< Key, T >::begin ( ) const
inlinenodiscard

◆ cbegin()

template<class Key, class T>
_MSTD_CONSTEXPR20 const_iterator mstd::ordered_map< Key, T >::cbegin ( ) const
inlinenodiscard

◆ cend()

template<class Key, class T>
_MSTD_CONSTEXPR20 const_iterator mstd::ordered_map< Key, T >::cend ( ) const
inlinenodiscard

◆ clear()

template<class Key, class T>
_MSTD_CONSTEXPR20 void mstd::ordered_map< Key, T >::clear ( )
inline

◆ contains() [1/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 bool mstd::ordered_map< Key, T >::contains ( const key_type & key) const
inlinenodiscard

◆ contains() [2/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 bool mstd::ordered_map< Key, T >::contains ( key_type && key) const
inlinenodiscard

◆ crbegin()

template<class Key, class T>
_MSTD_CONSTEXPR20 const_reverse_iterator mstd::ordered_map< Key, T >::crbegin ( ) const
inlinenodiscard

◆ crend()

template<class Key, class T>
_MSTD_CONSTEXPR20 const_reverse_iterator mstd::ordered_map< Key, T >::crend ( ) const
inlinenodiscard

◆ emplace() [1/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::emplace ( const_iterator where,
const key_type & key,
const mapped_type & value )
inline

◆ emplace() [2/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::emplace ( const_iterator where,
key_type && key,
mapped_type && value )
inline

◆ emplace_back() [1/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::emplace_back ( const key_type & key,
const mapped_type & value )
inline

◆ emplace_back() [2/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::emplace_back ( key_type && key,
mapped_type && value )
inline

◆ empty()

template<class Key, class T>
_MSTD_CONSTEXPR20 bool mstd::ordered_map< Key, T >::empty ( ) const
inlinenodiscard

◆ end() [1/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 iterator mstd::ordered_map< Key, T >::end ( )
inlinenodiscard

◆ end() [2/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 const_iterator mstd::ordered_map< Key, T >::end ( ) const
inlinenodiscard

◆ erase() [1/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 void mstd::ordered_map< Key, T >::erase ( const key_type & key)
inline

◆ erase() [2/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 void mstd::ordered_map< Key, T >::erase ( key_type && key)
inline

◆ find() [1/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 iterator mstd::ordered_map< Key, T >::find ( const key_type & key)
inlinenodiscard

◆ find() [2/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 const_iterator mstd::ordered_map< Key, T >::find ( const key_type & key) const
inlinenodiscard

◆ find() [3/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 iterator mstd::ordered_map< Key, T >::find ( key_type && key)
inlinenodiscard

◆ find() [4/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 const_iterator mstd::ordered_map< Key, T >::find ( key_type && key) const
inlinenodiscard

◆ insert() [1/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::insert ( const_iterator where,
const value_type & value )
inline

◆ insert() [2/4]

template<class Key, class T>
template<mstd::iterator_of< value_type > Iter>
_MSTD_CONSTEXPR20 void mstd::ordered_map< Key, T >::insert ( const_iterator where,
Iter begin,
Iter end )
inline

◆ insert() [3/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 void mstd::ordered_map< Key, T >::insert ( const_iterator where,
std::initializer_list< value_type > init )
inline

◆ insert() [4/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::insert ( const_iterator where,
value_type && value )
inline

◆ insert_back() [1/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::insert_back ( const value_type & value)
inline

◆ insert_back() [2/4]

template<class Key, class T>
template<mstd::iterator_of< value_type > Iter>
_MSTD_CONSTEXPR20 void mstd::ordered_map< Key, T >::insert_back ( Iter begin,
Iter end )
inline

◆ insert_back() [3/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 void mstd::ordered_map< Key, T >::insert_back ( std::initializer_list< value_type > init)
inline

◆ insert_back() [4/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::insert_back ( value_type && value)
inline

◆ operator!=()

template<class Key, class T>
_MSTD_CONSTEXPR20 bool mstd::ordered_map< Key, T >::operator!= ( const ordered_map< Key, T > & other) const
inlinenodiscard

◆ operator=() [1/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 ordered_map & mstd::ordered_map< Key, T >::operator= ( const ordered_map< Key, T > & other)
default

◆ operator=() [2/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 ordered_map & mstd::ordered_map< Key, T >::operator= ( ordered_map< Key, T > && other)
defaultnoexcept

◆ operator==()

template<class Key, class T>
_MSTD_CONSTEXPR20 bool mstd::ordered_map< Key, T >::operator== ( const ordered_map< Key, T > & other) const
inlinenodiscard

◆ operator[]() [1/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::operator[] ( const key_type & key)
inlinenodiscard

◆ operator[]() [2/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 const mapped_type & mstd::ordered_map< Key, T >::operator[] ( const key_type & key) const
inlinenodiscard

◆ operator[]() [3/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 mapped_type & mstd::ordered_map< Key, T >::operator[] ( key_type && key)
inlinenodiscard

◆ operator[]() [4/4]

template<class Key, class T>
_MSTD_CONSTEXPR20 const mapped_type & mstd::ordered_map< Key, T >::operator[] ( key_type && key) const
inlinenodiscard

◆ rbegin() [1/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 reverse_iterator mstd::ordered_map< Key, T >::rbegin ( )
inlinenodiscard

◆ rbegin() [2/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 const_reverse_iterator mstd::ordered_map< Key, T >::rbegin ( ) const
inlinenodiscard

◆ rend() [1/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 reverse_iterator mstd::ordered_map< Key, T >::rend ( )
inlinenodiscard

◆ rend() [2/2]

template<class Key, class T>
_MSTD_CONSTEXPR20 const_reverse_iterator mstd::ordered_map< Key, T >::rend ( ) const
inlinenodiscard

◆ size()

template<class Key, class T>
_MSTD_CONSTEXPR20 size_type mstd::ordered_map< Key, T >::size ( ) const
inlinenodiscard

Member Data Documentation

◆ _elementsMap

template<class Key, class T>
_map_type mstd::ordered_map< Key, T >::_elementsMap
private

◆ _orderedElements

template<class Key, class T>
_data_type mstd::ordered_map< Key, T >::_orderedElements
private