A sorted_vector_map is similar to a sorted_vector_set but stores <key,value> pairs instead of single elements.
Synopsis
Declared in <folly/container/sorted_vector_types.h>
template<
class Key,
class Value,
class Compare = std::less<Key>,
class Allocator = std::allocator<std::pair<Key, Value>>,
class GrowthPolicy = void,
class Container = std::vector<std::pair<Key, Value>, Allocator>>
class sorted_vector_map;
Types
Name |
Description |
Comparator that orders elements by their key. |
Type Aliases
Name |
Description |
The allocator type of the underlying container. |
|
Iterator over const elements. |
|
Pointer to a const element. |
|
Reference to a const element. |
|
Reverse iterator over const elements. |
|
The underlying container type. |
|
Signed difference type between two iterators. |
|
Guard type for direct mutation of the underlying container. |
|
Iterator over elements. |
|
The comparator type used to order keys. |
|
The key type of the map. |
|
The mapped value type of the map. |
|
Pointer to an element. |
|
Reference to an element. |
|
Reverse iterator over elements. |
|
Unsigned size type. |
|
The element type stored in the container (a key/value pair). |
Member Functions
Name |
Description |
|
Constructors |
Assignment operators |
|
Returns the value for key, or throws std::out_of_range if absent. |
|
|
|
Returns the number of elements the map can hold without reallocating. |
|
Returns a const iterator to the first element. |
|
Returns a const iterator past the last element. |
|
Removes all elements from the map. |
|
Returns true if the map contains key. |
|
Returns the number of elements matching key (0 or 1). |
|
Returns a const reverse iterator to the last element. |
|
Returns a const reverse iterator before the first element. |
|
Returns a pointer to the underlying contiguous storage. |
|
|
|
|
|
Returns true if the map has no elements. |
|
|
|
Returns the range of elements matching key. |
|
|
|
|
|
Returns the allocator associated with the underlying container. |
|
Returns a const reference to the underlying container. |
|
|
Directly mutate the container. |
|
|
|
|
Returns the comparator used to order keys. |
|
Returns an iterator to the first element not ordered before key. |
|
Returns the maximum number of elements the map can hold. |
|
Returns a reference to the value for key, inserting a default if absent. |
|
|
|
|
|
Reserves storage for at least s elements. |
|
Releases unused capacity back to the allocator. |
|
Returns the number of elements. |
|
Swaps the contents of this map with another. |
|
|
|
Inserts a value constructed in place from args if key k is absent. |
|
Returns an iterator to the first element ordered after key. |
|
Returns the comparator used to order elements. |
|
Returns true if both maps hold equal elements in the same order. |
|
Returns true if the maps differ. |
|
Compares two maps lexicographically. |
|
Compares two maps lexicographically. |
|
Compares two maps lexicographically. |
|
Compares two maps lexicographically. |
Friends
Name |
Description |
Compares two maps lexicographically by three‐way comparison. |
|
Erases every element for which predicate returns true; returns the count. |
Non-Member Functions
Name |
Description |
Swap function that can be found using ADL. |
Template Parameters
Name |
Description |
Key |
Key type |
Value |
Value type |
Compare |
Function that can compare key types and impose a strict weak ordering over them. |
Allocator |
allocation policy |
GrowthPolicy |
policy object to control growth |
Created with MrDocs