Sets are containers that store unique elements following a specific order.
In a set, the value of an element also identifies it (the value is itself the key, of type T), and each value must be unique. The value of the elements in a set cannot be modified once in the container (the elements are always const), but they can be inserted or removed from the container.
Internally, the elements in a set are always sorted following a specific strict weak ordering criterion indicated by its internal (of type Compare).
set containers are generally slower than containers to access individual elements by their key, but they allow the direct iteration on subsets based on their order.
Sets are typically implemented as binary search trees.
成员函数:
-
Construct set
(public member function )
-
Set destructor
(public member function )
-
Copy container content
(public member function )
Iterators:
- Return iterator to beginning (public member function )
- Return iterator to end (public member function )
- Return reverse iterator to reverse beginning (public member function )
- Return reverse iterator to reverse end (public member function )
- Return const_iterator to beginning (public member function )
- Return const_iterator to end (public member function )
- Return const_reverse_iterator to reverse beginning (public member function )
- Return const_reverse_iterator to reverse end (public member function )
Capacity:
- Test whether container is empty (public member function )
- Return container size (public member function )
- Return maximum size (public member function )
Modifiers:
- Insert element (public member function )
- Erase elements (public member function )
- Swap content (public member function )
- Clear content (public member function )
- Construct and insert element (public member function )
- Construct and insert element with hint (public member function )
Observers:
- Return comparison object (public member function )
- Return comparison object (public member function )
Operations:
- Get iterator to element (public member function )
- Count elements with a specific value (public member function )
- Return iterator to lower bound (public member function )
- Return iterator to upper bound (public member function )
- Get range of equal elements (public member function )
Allocator:
- Get allocator (public member function )