vecs
Fast, flexible ecs in C++ with ergonomic API
Loading...
Searching...
No Matches
vecs::storage::dense_map< Key, Value, typename > Class Template Reference

A dense map optimized for integral keys. More...

#include <dense_map.h>

Public Types

using pair_type = std::pair<Key, Value>
 
using iterator = typename std::vector<pair_type>::iterator
 
using const_iterator = typename std::vector<pair_type>::const_iterator
 

Public Member Functions

void insert (const Key &key, const Value &value)
 
iterator find (const Key &key)
 
const_iterator find (const Key &key) const
 
Value & operator[] (const Key &key)
 
void clear ()
 
void erase (const Key &key)
 
iterator erase (iterator it)
 
size_t size () const
 
bool empty () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 

Detailed Description

template<typename Key, typename Value, typename = std::enable_if_t<std::is_integral_v<Key>>>
class vecs::storage::dense_map< Key, Value, typename >

A dense map optimized for integral keys.

This map uses sorted vectors to store keys and values, optimized for integer-based keys.

Template Parameters
KeyThe integral type of the key.
ValueThe type of the value associated with each key.

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