NcEngine
nc::sparse_map< Value, Key > Class Template Reference

A map-like container with O(1) insertion, removal, and lookup and O(N) iteration. More...

#include <SparseMap.h>

Public Member Functions

 sparse_map (size_t initialKeyCapacity, size_t maxKeyCapacity=65536ull)
 
auto emplace (Key key, const Value &value) -> Value &
 
auto emplace (Key key, Value &&value) -> Value &
 
auto erase (Key key) -> bool
 
auto contains (Key key) const noexcept -> bool
 
void reserve (size_t capacity)
 
void reserve_keys (size_t capacity)
 
void clear ()
 
auto at (Key key) -> Value &
 
auto at (Key key) const -> const Value &
 
auto keys () noexcept -> std::span< Key >
 
auto keys () const noexcept -> std::span< const Key >
 
auto values () noexcept -> std::span< Value >
 
auto values () const noexcept -> std::span< const Value >
 
auto size () const noexcept -> size_t
 
auto empty () const noexcept -> bool
 
auto size_keys () const noexcept
 
auto capacity () const noexcept
 
auto capacity_keys () const noexcept
 
auto begin ()
 
auto begin () const
 
auto cbegin () const
 
auto end ()
 
auto end () const
 
auto cend () const
 

Static Public Attributes

static constexpr auto NullIndex = UINT32_MAX
 

Detailed Description

template<std::movable Value, std::convertible_to< uint32_t > Key = uint32_t>
class nc::sparse_map< Value, Key >

A map-like container with O(1) insertion, removal, and lookup and O(N) iteration.


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