Template Class HashMultiset
Defined in File HashMultiset.h
Class Documentation
-
template<class T, class H = std::hash<T>>
class HashMultiset a multiset on a hash table, a counter of occurrences per item: the insertion of a new item sets it to 1, of an item already there adds 1, the removal subtracts 1 and removes the item at 0 (exercise 8.10)
Public Types
-
using iterator = const_iterator
Public Functions
-
HashMultiset(void)
-
std::size_t size(void) const
the number of items, each counted as many times as it occurs
-
std::size_t distinct(void) const
the number of distinct items
-
bool empty(void) const
-
void remove(const T &x)
removes one occurrence of x, if there is one
- Post:
one occurrence of x less, or none
-
inline const_iterator begin(void) const
-
inline const_iterator end(void) const
-
inline const_iterator cbegin(void) const
-
inline const_iterator cend(void) const
-
using iterator = const_iterator