Specialize heap_vector_map to integral key type and std::less comparaison. small_heap_map achieve a very fast find for small map < 200 elements.
Synopsis
Declared in <folly/container/heap_vector_types.h>
template<
typename Key,
typename Value,
typename SizeType = uint32_t,
class Container = folly::small_vector<std::pair<Key, Value>, 0, folly::small_vector_policy::policy_size_type<SizeType>>>
requires std::is_integral<Key>::value || std::is_enum<Key>::value
class small_heap_vector_map
: public folly::heap_vector_map<Key, Value, std::less<Key>, Container::allocator_type, void, Container>
Base Classes
Name |
Description |
A heap_vector_map based on heap layout. |
Types
Name |
Type Aliases
Name |
Description |
The allocator type. |
|
Const iterator over the map's elements. |
|
Const reference to an element. |
|
Const reverse iterator over the map's elements. |
|
The underlying container type. |
|
Signed integer type for iterator differences. |
|
Iterator over the map's elements. |
|
The comparison function over keys. |
|
The key type. |
|
The mapped value type. |
|
Pointer to an element. |
|
Reference to an element. |
|
Reverse iterator over the map's elements. |
|
Unsigned integer type for sizes. |
|
The comparison function over elements. |
|
The element type stored in the container. |
Member Functions
Name |
Description |
Assignment operators |
|
|
|
|
|
Returns a reference to the value for the given key, inserting a default‐constructed value if the key doesn't exist. |
|
Directly swap the container. Similar to swap() |
|
Equality operator |
|
Inequality operator |
|
Three‐way comparison operator |
Using Declarations
Protected Types
Name |
Protected Type Aliases
Name |
Description |
The underlying heap_vector_container base type. |
|
Protected Member Functions
Protected Static Member Functions
Protected Data Members
Name |