CAF 0.17.6
Loading...
Searching...
No Matches
caf::detail::unordered_flat_map< Key, T, Allocator > Class Template Reference

A map abstraction with an unsorted std::vector providing O(n) lookup. More...

#include <unordered_flat_map.hpp>

Public Types

using key_type = Key
using mapped_type = T
using value_type = std::pair<Key, T>
using vector_type = std::vector<value_type, Allocator>
using allocator_type = typename vector_type::allocator_type
using size_type = typename vector_type::size_type
using difference_type = typename vector_type::difference_type
using reference = typename vector_type::reference
using const_reference = typename vector_type::const_reference
using pointer = typename vector_type::pointer
using const_pointer = typename vector_type::const_pointer
using iterator = typename vector_type::iterator
using const_iterator = typename vector_type::const_iterator
using reverse_iterator = typename vector_type::reverse_iterator
using const_reverse_iterator = typename vector_type::const_reverse_iterator

Public Member Functions

 unordered_flat_map (std::initializer_list< value_type > l)
template<class InputIterator>
 unordered_flat_map (InputIterator first, InputIterator last)
iterator begin () noexcept
const_iterator begin () const noexcept
const_iterator cbegin () const noexcept
reverse_iterator rbegin () noexcept
const_reverse_iterator rbegin () const noexcept
iterator end () noexcept
const_iterator end () const noexcept
const_iterator cend () const noexcept
reverse_iterator rend () noexcept
const_reverse_iterator rend () const noexcept
bool empty () const noexcept
size_type size () const noexcept
void reserve (size_type count)
void shrink_to_fit ()
vector_type & container () noexcept
 Gives raw access to the underlying container.
const vector_type & container () const noexcept
 Gives raw access to the underlying container.
void clear () noexcept
void swap (unordered_flat_map &other)
std::pair< iterator, bool > insert (value_type x)
iterator insert (iterator hint, value_type x)
iterator insert (const_iterator hint, value_type x)
template<class InputIterator>
void insert (InputIterator first, InputIterator last)
template<class... Ts>
std::pair< iterator, bool > emplace (Ts &&... xs)
template<class... Ts>
iterator emplace_hint (const_iterator hint, Ts &&... xs)
iterator erase (const_iterator i)
iterator erase (const_iterator first, const_iterator last)
size_type erase (const key_type &x)
template<class K>
mapped_type & at (const K &key)
template<class K>
const mapped_type & at (const K &key) const
mapped_type & operator[] (const key_type &key)
template<class K>
iterator find (const K &key)
template<class K>
const_iterator find (const K &key) const
template<class K>
size_type count (const K &key) const

(Note that these are not member symbols.)

template<class K, class T, class A>
bool operator== (const unordered_flat_map< K, T, A > &xs, const unordered_flat_map< K, T, A > &ys)
template<class K, class T, class A>
bool operator!= (const unordered_flat_map< K, T, A > &xs, const unordered_flat_map< K, T, A > &ys)
template<class K, class T, class A>
bool operator< (const unordered_flat_map< K, T, A > &xs, const unordered_flat_map< K, T, A > &ys)
template<class K, class T, class A>
bool operator>= (const unordered_flat_map< K, T, A > &xs, const unordered_flat_map< K, T, A > &ys)

Detailed Description

template<class Key, class T, class Allocator = std::allocator<std::pair<Key, T>>>
class caf::detail::unordered_flat_map< Key, T, Allocator >

A map abstraction with an unsorted std::vector providing O(n) lookup.

Member Function Documentation

◆ at()

template<class Key, class T, class Allocator = std::allocator<std::pair<Key, T>>>
template<class K>
const mapped_type & caf::detail::unordered_flat_map< Key, T, Allocator >::at ( const K & key) const

We call the non-const version in order to avoid code duplication but restore the const-ness when returning from the function.

◆ find()

template<class Key, class T, class Allocator = std::allocator<std::pair<Key, T>>>
template<class K>
const_iterator caf::detail::unordered_flat_map< Key, T, Allocator >::find ( const K & key) const

We call the non-const version in order to avoid code duplication but restore the const-ness when returning from the function.


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