28#ifndef __ADS_HashMultiset
29 #define __ADS_HashMultiset
62template<
class T ,
class H = std::hash< T > >
74 [[nodiscard]] std::size_t
size(
void )
const;
77 [[nodiscard]] std::size_t
distinct(
void )
const;
80 [[nodiscard]]
bool empty(
void )
const;
83 [[nodiscard]]
bool contains(
const T & x )
const;
86 [[nodiscard]] std::size_t
count(
const T & x )
const;
137 return( f_count.begin() );
149 [[nodiscard]]
bool counted(
void )
const;
153 std::size_t f_size = 0;
165#include "ADS/set/impl/HashMultiset.tpp"
The hash table with lists of overflow of section 7.2.1, a realization of the DICTIONARY [see ADT....
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
a hash table with lists of overflow
Definition ChainedHashTable.h:103
std::size_t size(void) const
the number of items, each counted as many times as it occurs
const_iterator iterator
the same, constant
Definition HashMultiset.h:133
T Item
the type of the items
Definition HashMultiset.h:68
const_iterator begin(void) const
the iterator on the first pair
Definition HashMultiset.h:136
const_iterator end(void) const
the iterator past the last pair
Definition HashMultiset.h:140
bool empty(void) const
whether the multiset has no item
void remove(const T &x)
one occurrence of less, if there is one
std::size_t distinct(void) const
the number of distinct items
const_iterator cbegin(void) const
as begin()
Definition HashMultiset.h:142
typename ChainedHashTable< T, std::size_t, Chain::FRONT, H >::const_iterator const_iterator
the iterator of the table of the counters, constant
Definition HashMultiset.h:130
std::size_t count(const T &x) const
the occurrences of , 0 if none
const_iterator cend(void) const
as end()
Definition HashMultiset.h:144
bool contains(const T &x) const
whether occurs at least once
void forEach(F &&f) const
f( x , c ) on the distinct items and their occurrences
HashMultiset(void)
the empty multiset
std::pair< T, std::size_t > value_type
a pair of an item and its occurrences
Definition HashMultiset.h:128
void insert(const T &x)
one occurrence of more
@ FRONT
a new key at the head, nothing moves
Definition ChainedHashTable.h:93