Template Class SmallMap#
Defined in File small_map.h
Class Documentation#
-
template<typename Key, typename Value, typename Compare = std::less<Key>>
class SmallMap# Sorted associative container backed by a contiguous std::vector. Cheaper than std::map for small sizes and cache-friendly to iterate. Insertion and erasure are O(n), lookup is O(log n).
Public Types
-
using container_type = std::vector<value_type>#
-
using iterator = typename container_type::iterator#
-
using const_iterator = typename container_type::const_iterator#
-
using size_type = typename container_type::size_type#
Public Functions
-
SmallMap() = default#
-
inline SmallMap(std::initializer_list<value_type> init, Compare comp = Compare())#
-
inline const_iterator begin() const noexcept#
-
inline const_iterator end() const noexcept#
-
inline const_iterator cbegin() const noexcept#
-
inline const_iterator cend() const noexcept#
-
inline bool empty() const noexcept#
-
inline void clear() noexcept#
-
inline const_iterator find(const Key &key) const#
-
inline std::pair<iterator, bool> insert(const value_type &kv)#
-
inline std::pair<iterator, bool> insert(value_type &&kv)#
-
inline iterator erase(const_iterator pos)#
-
inline container_type &data() noexcept#
-
inline const container_type &data() const noexcept#
-
inline key_compare key_comp() const#
-
using container_type = std::vector<value_type>#