|
momo
3.11
|
This project contains an implementation of the C++ containers, similar to the standard set/map and unordered_set/map, but much more efficient in memory usage. As for the operation speed, these containers are also better than the standard ones in most cases (benchmark of unordered containers, benchmark of ordered containers, benchmark sources).
Classes are designed in close conformity with the standard C++20 including exception safety guarantees. The compiler only needs to support C++11.
std::vector.map and unordered_map type reference is a pair of references (same as in std::flat_map), so for (auto& p : map) is illegal, but for (auto p : map) or for (const auto& p : map) or for (auto&& p : map) is allowed.set/map is based on a B-tree.unordered_set/map are hash tables with buckets in the form of small arrays.This library is header-only and has zero dependencies. So you can just copy the folder include/momo into your source code.
Classes set/map and unordered_set/map are located in subfolder stdish, namespace momo::stdish.
Some documentation is here.
stdish::unordered_set_open and stdish::unordered_map_open are based on open addressing hash tables.stdish::vector_intcap is vector with internal capacity. This vector doesn't need dynamic memory while its size is not greater than user-defined constant.stdish::unordered_multimap is similar to std::unordered_multimap, but each of duplicate keys is stored only once.stdish::multiset and stdish::multimap are similar to std::multiset and std::multimap.stdish::unsynchronized_pool_allocator is allocator with a pool of memory for containers like std::list or std::map. Each copy of the container keeps its own memory pool. Memory is released not only after destruction of the object, but also in case of removal sufficient number of items.momo also contains many of the analogous classes with non-standard interface, but more flexible, namely HashSet, HashMap, HashMultiMap, TreeSet, TreeMap, Array, SegmentedArray, MemPool.momo::DataTable is similar to Boost.MultiIndex, but its API looks like ADO.NET DataTable. Some examples are here.