emilib
Public Types | Public Member Functions | List of all members
emilib::ListMap< KeyT, ValueT, EqT > Class Template Reference

Linear lookup map for quick lookups among few values. More...

#include <list_map.hpp>

Public Types

using Pair = std::pair< KeyT, ValueT >
 
using List = std::vector< Pair >
 
using size_type = size_t
 
using value_type = Pair
 
using reference = Pair &
 
using const_reference = const Pair &
 
using iterator = typename List::iterator
 
using const_iterator = typename List::const_iterator
 

Public Member Functions

iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 
bool empty () const
 
iterator find (const KeyT &key)
 
const_iterator find (const KeyT &key) const
 
size_t count (const KeyT &key) const
 
ValueT & operator[] (const KeyT &key)
 
const ValueT & at (const KeyT &key) const
 
bool insert (const Pair &p)
 
void insert_or_assign (const KeyT &key, ValueT &&value)
 
iterator erase (iterator it)
 
void erase (const KeyT &key)
 
void shrink_to_fit ()
 Frees unnecessary memory.
 
void clear ()
 

Detailed Description

template<typename KeyT, typename ValueT, typename EqT = ListMapEqualTo<KeyT>>
class emilib::ListMap< KeyT, ValueT, EqT >

Linear lookup map for quick lookups among few values.


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