|
Infrared
|
Space saving replacement for map. More...
#include <simple_map.hpp>


Public Member Functions | |
| SimpleMap () | |
| const_iterator | find (const key_t &key) const |
| iterator | find (const key_t &key) |
| bool | exists (const key_t &key) const |
| auto | end () const |
| void | push_ascending (const key_t &key, const val_t &val) |
| push in ascending order of keys | |
| void | erase (iterator it) |
| size_t | size () const |
| size_t | capacity () const |
| void | reallocate () |
Space saving replacement for map.
Maintains lists of values in idx sorted lists, allowing log-time access and efficient traversal. Erasing elements is supported, but takes linear time. Still, this data structure seems to be a good compromise, since e.g. balanced trees or hashs require a lot of space.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
push in ascending order of keys
| key | |
| val |
successive push_ascending must be in ascending order of the key type
|
inline |
|
inline |