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

Types

Type Aliases

Name

Description

allocator_type

The allocator type.

const_iterator

Const iterator over the map's elements.

const_reference

Const reference to an element.

const_reverse_iterator

Const reverse iterator over the map's elements.

container_type

The underlying container type.

difference_type

Signed integer type for iterator differences.

iterator

Iterator over the map's elements.

key_compare

The comparison function over keys.

key_type

The key type.

mapped_type

The mapped value type.

pointer

Pointer to an element.

reference

Reference to an element.

reverse_iterator

Reverse iterator over the map's elements.

size_type

Unsigned integer type for sizes.

value_compare

The comparison function over elements.

value_type

The element type stored in the container.

Member Functions

Name

Description

operator=

Assignment operators

at

at overloads

begin

capacity

cbegin

cend

clear

contains

count

crbegin

crend

data

emplace

emplace_hint

empty

end

equal_range

erase

find

find overloads

get_allocator

get_container

insert

iterate

key_comp

lower_bound

max_size

operator[]

Returns a reference to the value for the given key, inserting a default‐constructed value if the key doesn't exist.

rbegin

rend

reserve

shrink_to_fit

size

swap

swap_container

Directly swap the container. Similar to swap()

upper_bound

value_comp

operator==

Equality operator

operator!=

Inequality operator

operator<=>

Three‐way comparison operator

Using Declarations

Protected Types

Name

EBO

Protected Type Aliases

Name

Description

heap_vector_container

The underlying heap_vector_container base type.

if_is_transparent

self_iterator_t

Protected Member Functions

Protected Static Member Functions

Protected Data Members

Name

m_

Protected Using Declarations

Non-Member Functions

Name

Description

swap

Swap function that can be found using ADL.

Created with MrDocs