A sorted_vector_set is a container similar to std::set<>, but implemented as a sorted array with std::vector<>.
Synopsis
Declared in <folly/container/sorted_vector_types.h>
template<
class T,
class Compare = std::less<T>,
class Allocator = std::allocator<T>,
class GrowthPolicy = void,
class Container = std::vector<T, Allocator>>
class sorted_vector_set;
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 set (same as the element type). |
|
Pointer to an element. |
|
Reference to an element. |
|
Reverse iterator over elements. |
|
Unsigned size type. |
|
The comparator type used to order elements. |
|
The element type stored in the set. |
Member Functions
Name |
Description |
|
Constructors |
Assignment operators |
|
|
|
Returns the number of elements the set 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 set. |
|
Returns true if the set contains key. |
|
Returns the number of elements matching key (0 or 1). |
|
Returns a pointer to the underlying contiguous storage. |
|
|
|
|
|
Returns true if the set 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 set can hold. |
|
|
|
|
|
Reserves storage for at least s elements. |
|
Releases unused capacity back to the allocator. |
|
Returns the number of elements. |
|
Swaps the contents of this set with another. |
|
|
|
Returns an iterator to the first element ordered after key. |
|
Returns the comparator used to order elements. |
|
Returns true if both sets hold equal elements in the same order. |
|
Returns true if the sets differ. |
|
Compares two sets lexicographically. |
|
Compares two sets lexicographically. |
|
Compares two sets lexicographically. |
|
Compares two sets lexicographically. |
Friends
Name |
Description |
Compares two sets 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 |
T |
Data type to store |
Compare |
Comparison function that imposes a strict weak ordering over instances of T |
Allocator |
allocation policy |
GrowthPolicy |
policy object to control growth |
Created with MrDocs