|
constexpr | static_set ()=default |
| Constructs empty container.
|
|
template<typename InputIt>
requires (detail::InputIterator<InputIt>) |
constexpr | static_set (InputIt first, InputIt last) |
| Constructs with the contents of the range [first, last). If multiple elements in the range have keys that compare equivalent, all but the first will be discarded.
|
|
constexpr | static_set (static_set &&other) noexcept(noexcept(etl::move(declval< storage_type >())))=default |
|
constexpr | static_set (static_set const &other)=default |
|
constexpr auto | begin () const noexcept -> const_iterator |
| Returns an iterator to the first element of the set.
|
|
constexpr auto | begin () noexcept -> iterator |
| Returns an iterator to the first element of the set.
|
|
constexpr auto | cbegin () const noexcept -> const_iterator |
| Returns an iterator to the first element of the set.
|
|
constexpr auto | cend () const noexcept -> const_iterator |
| Returns an iterator to the element following the last element of the set.
|
|
constexpr auto | clear () noexcept -> void |
| Erases all elements from the container. After this call, size() returns zero.
|
|
template<typename K>
requires (detail::is_transparent_v<key_compare>) |
constexpr auto | contains (K const &x) const -> bool |
| Checks if there is an element with key that compares equivalent to the value x.
|
|
constexpr auto | contains (key_type const &key) const noexcept -> bool |
| Checks if there is an element with key equivalent to key in the container.
|
|
template<typename K>
requires (detail::is_transparent_v<key_compare>) |
constexpr auto | count (K const &x) const -> size_type |
| Returns the number of elements with key that compares equivalent to the value x.
|
|
constexpr auto | count (key_type const &key) const noexcept -> size_type |
| Returns the number of elements with key that compares equivalent to the specified argument, which is either 1 or 0 since this container does not allow duplicates.
|
|
constexpr auto | crbegin () const noexcept -> const_reverse_iterator |
| Returns a reverse iterator to the first element of the reversed set. It corresponds to the last element of the non-reversed set.
|
|
constexpr auto | crend () const noexcept -> const_reverse_iterator |
| Returns a reverse iterator to the element following the last element of the reversed set. It corresponds to the element preceding the first element of the non-reversed set.
|
|
template<typename... Args>
requires (is_copy_constructible_v<key_type>) |
constexpr auto | emplace (Args &&... args) noexcept(noexcept(insert(declval< key_type >()))) -> pair< iterator, bool > |
| Inserts a new element into the container constructed in-place with the given args if there is no element with the key in the container.
|
|
constexpr auto | empty () const noexcept -> bool |
| Checks if the container has no elements, i.e. whether begin() == end().
|
|
constexpr auto | end () const noexcept -> const_iterator |
| Returns an iterator to the element following the last element of the set.
|
|
constexpr auto | end () noexcept -> iterator |
| Returns an iterator to the element following the last element of the set.
|
|
template<typename K>
requires (detail::is_transparent_v<key_compare>) |
constexpr auto | equal_range (K const &key) -> iterator |
| Returns a range containing all elements with the given key in the container. The range is defined by two iterators, one pointing to the first element that is not less than key and another pointing to the first element greater than key. Alternatively, the first iterator may be obtained with lower_bound(), and the second with upper_bound().
|
|
template<typename K>
requires (detail::is_transparent_v<key_compare>) |
constexpr auto | equal_range (K const &key) const -> const_iterator |
| Returns a range containing all elements with the given key in the container. The range is defined by two iterators, one pointing to the first element that is not less than key and another pointing to the first element greater than key. Alternatively, the first iterator may be obtained with lower_bound(), and the second with upper_bound().
|
|
constexpr auto | equal_range (key_type const &key) -> iterator |
| Returns a range containing all elements with the given key in the container. The range is defined by two iterators, one pointing to the first element that is not less than key and another pointing to the first element greater than key. Alternatively, the first iterator may be obtained with lower_bound(), and the second with upper_bound().
|
|
constexpr auto | equal_range (key_type const &key) const -> const_iterator |
| Returns a range containing all elements with the given key in the container. The range is defined by two iterators, one pointing to the first element that is not less than key and another pointing to the first element greater than key. Alternatively, the first iterator may be obtained with lower_bound(), and the second with upper_bound().
|
|
constexpr auto | erase (iterator first, iterator last) -> iterator |
| Removes the elements in the range [first; last), which must be a valid range in *this.
|
|
constexpr auto | erase (iterator pos) noexcept -> iterator |
| Removes the element at pos.
|
|
constexpr auto | erase (key_type const &key) noexcept -> size_type |
| Removes the element (if one exists) with the key equivalent to key.
|
|
template<typename K>
requires (detail::is_transparent_v<key_compare>) |
constexpr auto | find (K const &x) -> iterator |
| Finds an element with key that compares equivalent to the value x.
|
|
template<typename K>
requires (detail::is_transparent_v<key_compare>) |
constexpr auto | find (K const &x) const -> const_iterator |
| Finds an element with key that compares equivalent to the value x.
|
|
constexpr auto | find (key_type const &key) const noexcept -> const_iterator |
| Finds an element with key equivalent to key.
|
|
constexpr auto | find (key_type const &key) noexcept -> iterator |
| Finds an element with key equivalent to key.
|
|
constexpr auto | full () const noexcept -> bool |
| Checks if the container full, i.e. whether size() == Capacity.
|
|
template<typename InputIter>
requires (detail::InputIterator<InputIter>) |
constexpr auto | insert (InputIter first, InputIter last) noexcept(noexcept(insert(declval< key_type >()))) -> void |
| Inserts elements from range [first, last). If multiple elements in the range have keys that compare equivalent, it is unspecified which element is inserted (pending LWG2844).
|
|
constexpr auto | insert (value_type &&value) -> pair< iterator, bool > requires(is_move_constructible_v< value_type >) |
| Inserts element into the container, if the container doesn't already contain an element with an equivalent key.
|
|
constexpr auto | insert (value_type const &value) noexcept(noexcept(insert(etl::move(declval< key_type >())))) -> pair< iterator, bool > requires(is_copy_constructible_v< value_type >) |
| Inserts element into the container, if the container doesn't already contain an element with an equivalent key.
|
|
constexpr auto | key_comp () const noexcept -> key_compare |
| Returns the function object that compares the keys, which is a copy of this container's constructor argument comp. It is the same as value_comp.
|
|
template<typename K>
requires (detail::is_transparent_v<key_compare>) |
constexpr auto | lower_bound (K const &key) -> iterator |
| Returns an iterator pointing to the first element that is not less than (i.e. greater or equal to) key.
|
|
template<typename K>
requires (detail::is_transparent_v<key_compare>) |
constexpr auto | lower_bound (K const &key) const -> const_iterator |
| Returns an iterator pointing to the first element that is not less than (i.e. greater or equal to) key.
|
|
constexpr auto | lower_bound (key_type const &key) -> iterator |
| Returns an iterator pointing to the first element that is not less than (i.e. greater or equal to) key.
|
|
constexpr auto | lower_bound (key_type const &key) const -> const_iterator |
| Returns an iterator pointing to the first element that is not less than (i.e. greater or equal to) key.
|
|
constexpr auto | max_size () const noexcept -> size_type |
| Returns the maximum number of elements the container is able to hold.
|
|
constexpr auto | operator= (static_set &&other) noexcept(noexcept(etl::move(declval< storage_type >()))) -> static_set &=default |
|
constexpr auto | operator= (static_set const &other) -> static_set &=default |
|
constexpr auto | rbegin () const noexcept -> const_reverse_iterator |
| Returns a reverse iterator to the first element of the reversed set. It corresponds to the last element of the non-reversed set.
|
|
constexpr auto | rbegin () noexcept -> reverse_iterator |
| Returns a reverse iterator to the first element of the reversed set. It corresponds to the last element of the non-reversed set.
|
|
constexpr auto | rend () const noexcept -> const_reverse_iterator |
| Returns a reverse iterator to the element following the last element of the reversed set. It corresponds to the element preceding the first element of the non-reversed set.
|
|
constexpr auto | rend () noexcept -> reverse_iterator |
| Returns a reverse iterator to the element following the last element of the reversed set. It corresponds to the element preceding the first element of the non-reversed set.
|
|
constexpr auto | size () const noexcept -> size_type |
| Returns the number of elements in the container, i.e. distance(begin(), end()).
|
|
constexpr auto | swap (static_set &other) noexcept(is_nothrow_swappable_v< key_type >) -> void requires(is_assignable_v< key_type &, key_type && >) |
| Exchanges the contents of the container with those of other.
|
|
template<typename K>
requires (detail::is_transparent_v<key_compare>) |
constexpr auto | upper_bound (K const &key) -> iterator |
| Returns an iterator pointing to the first element that is greater than key.
|
|
template<typename K>
requires (detail::is_transparent_v<key_compare>) |
constexpr auto | upper_bound (K const &key) const -> const_iterator |
| Returns an iterator pointing to the first element that is greater than key.
|
|
constexpr auto | upper_bound (key_type const &key) -> iterator |
| Returns an iterator pointing to the first element that is greater than key.
|
|
constexpr auto | upper_bound (key_type const &key) const -> const_iterator |
| Returns an iterator pointing to the first element that is greater than key.
|
|
constexpr auto | value_comp () const noexcept -> value_compare |
| Returns the function object that compares the values. It is the same as key_comp.
|
|
template<typename Key,
size_t Capacity, typename Compare = less<Key>>
struct etl::static_set< Key, Capacity, Compare >
static_set is an associative container that contains a sorted set of unique objects of type Key. Sorting is done using the key comparison function Compare.
- Examples
- set.cpp.