|
| iterator | begin () |
| | Return iterator to the first element.
|
| |
| const_iterator | begin () const |
| | Return const iterator to the first element.
|
| |
| const_iterator | cbegin () const |
| | Return const iterator to the first element.
|
| |
| iterator | end () |
| | Return iterator past the last element.
|
| |
| const_iterator | end () const |
| | Return const iterator past the last element.
|
| |
| const_iterator | cend () const |
| | Return const iterator past the last element.
|
| |
| size_t | size () const |
| | Return the number of elements in the set.
|
| |
| bool | empty () const |
| | Return true if the set is empty.
|
| |
| void | reserve (size_t n) |
| | Reserve storage for at least n elements.
|
| |
| size_t | capacity () const |
| | Return the current storage capacity.
|
| |
| template<class K , class = std::enable_if_t<std::is_convertible<K, T>{}>> |
| iterator | find (K &&k) |
| | Find an element equal to k.
|
| |
| template<class K , class = std::enable_if_t<std::is_convertible<K, T>{}>> |
| const_iterator | find (K &&k) const |
| | Find an element equal to k (const overload).
|
| |
| iterator | erase (const_iterator it) |
| | Remove the element at it.
|
| |
| template<class K , class = std::enable_if_t<std::is_convertible<K,T>{}>> |
| void | insert (const K &value) |
| | Insert value if not already present (const-ref overload).
|
| |
| template<class K , class = std::enable_if_t<std::is_convertible<K,T>{}>> |
| void | insert (K &&value) |
| | Insert value if not already present (rvalue overload).
|
| |
| bool | operator== (const flat_set &rhs) const |
| | Compare two flat_sets for equality (order-independent).
|
| |
| bool | operator< (const flat_set &rhs) const |
| | Less-than comparison based on minimum differing element.
|
| |
template<class T, template< class ... >class Storage = std::vector, class hash = std::hash<T>>
struct flat_set< T, Storage, hash >
Flat set with pluggable storage.
- Template Parameters
-
| T | Element type. Must be equality-comparable. |
| Storage | Container template for storage (default: std::vector). |
| hash | Hash functor for elements (used by the std::hash specialisation, default: std::hash<T>). |
Definition at line 41 of file flat_set.hpp.
template<class T , template< class ... >class Storage = std::vector, class hash = std::hash<T>>
template<class K , class = std::enable_if_t<std::is_convertible<K, T>{}>>
Find an element equal to k.
- Parameters
-
- Returns
- Iterator to the element, or
end() if not found.
Definition at line 104 of file flat_set.hpp.
template<class T , template< class ... >class Storage = std::vector, class hash = std::hash<T>>
template<class K , class = std::enable_if_t<std::is_convertible<K, T>{}>>
Find an element equal to k (const overload).
- Parameters
-
- Returns
- Const iterator to the element, or
end() if not found.
Definition at line 113 of file flat_set.hpp.
template<class T , template< class ... >class Storage = std::vector, class hash = std::hash<T>>
template<class K , class = std::enable_if_t<std::is_convertible<K,T>{}>>
| void flat_set< T, Storage, hash >::insert |
( |
const K & |
value | ) |
|
|
inline |
Insert value if not already present (const-ref overload).
- Parameters
-
Definition at line 129 of file flat_set.hpp.
template<class T , template< class ... >class Storage = std::vector, class hash = std::hash<T>>
template<class K , class = std::enable_if_t<std::is_convertible<K,T>{}>>
| void flat_set< T, Storage, hash >::insert |
( |
K && |
value | ) |
|
|
inline |
Insert value if not already present (rvalue overload).
- Parameters
-
| value | Element to insert (moved). |
Definition at line 140 of file flat_set.hpp.