Template Class LinearSet
Defined in File linear-set.h
Class Documentation
-
template<typename T>
class LinearSet A sorted container of unique elements with contiguous storage.
- Param <T>
The type of eleemnts to store
Public Functions
-
LinearSet() = default
Constructs an instance of LinearSet<>
-
inline std::vector<T>::const_iterator begin() const
Gets an iterator to this LinearSet<>'s first element.
- Returns
An iterator to this LinearSet<>'s first element
-
inline std::vector<T>::const_iterator end() const
Gets an iterator to this LinearSet<>'s last element.
- Returns
An iterator to this LinearSet<>'s last element
-
inline bool empty() const
Gets a value indicating whether or not this LinearSet<> is empty.
- Returns
Whether or not this LinearSet<> is empty
-
inline size_t size() const
Gets the number of elements in this LinearSet<>
- Returns
The number of elements in this LinearSet<>
-
inline void clear()
Clears all elements from this LinearSet<>
-
inline std::pair<typename std::vector<T>::const_iterator, bool> insert(T const &element)
Inserts an element into this LinearSet<> if the element is not already present.
- Parameters
element -- [in] The element to insert
- Returns
An std::pair<> consisting of an iterator to the inserted element and a value indicating whether or not an insertion occured