46#ifndef __ADS_DictionarySet
47 #define __ADS_DictionarySet
91 using Item =
typename D::Key;
94 template<
class... A >
95 requires std::constructible_from< D , A... >
99 [[nodiscard]] std::size_t
size(
void )
const;
102 [[nodiscard]]
bool empty(
void )
const;
170 [[nodiscard]]
auto begin(
void )
const
171 requires std::ranges::forward_range< const D >
173 return(
KeyIterator( std::ranges::begin( std::as_const( f_d ) ) ) );
177 [[nodiscard]]
auto end(
void )
const
178 requires std::ranges::forward_range< const D >
180 return(
KeyIterator( std::ranges::end( std::as_const( f_d ) ) ) );
186 [[nodiscard]]
static typename D::Value mark(
void );
193template<
class T ,
class H = std::hash< T > >
198template<
class T ,
class H = std::hash< T > >
202template< std::totally_ordered T >
211#include "ADS/set/impl/DictionarySet.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,...
The iterators that the containers of the library have in common, beyond the book: they give a contain...
The hash table with open addressing of section 7.2.2, a realization of the DICTIONARY [see ADT....
The binary search tree (ABR) and the Red-Black tree of the book, as a DICTIONARY [see ADT....
The interfaces of chapter 1 of Morin's book for the sets, beyond the book, as concepts of C++20 [see ...
The operations of chapter 8 on any SET that can be copied and has the foreach, forEach( f ): the unio...
a set on a DICTIONARY D, an item being a key: a USet of Morin if D is a KeyedDictionary,...
Definition DictionarySet.h:87
const Item * find(const Item &x) const
the address of the item equal to , nil if none, by findKey() of the dictionary: the find( x ) of a US...
bool contains(const Item &x) const
whether is a key of the dictionary
auto begin(void) const
the iterator on the first key of the dictionary
Definition DictionarySet.h:170
const D & dictionary(void) const
the dictionary
bool remove(const Item &x)
out of the set, the key removed from the dictionary
DictionarySet(A &&... a)
the empty set on the dictionary D( a... )
std::size_t size(void) const
the number of items, the keys of the dictionary
void forEach(F &&f) const
f( x ) on the items, in the order of the dictionary
bool empty(void) const
whether the set has no item
const Item * lowerBound(const Item &x) const
the address of the smallest item not smaller than , nil if none, by lowerBoundKey() of the dictionary...
typename D::Key Item
the type of the items
Definition DictionarySet.h:91
auto end(void) const
the iterator past the last key of the dictionary
Definition DictionarySet.h:177
bool insert(const Item &x)
into the set, as the key of the value true (or of the value made by default, for values that are not ...
the member first of what the iterator I reads, with the category of I up to bidirectional
Definition Iterators.h:793
a dictionary that gives the address of the key equal to the one asked, on which DictionarySet is a US...
Definition SetInterfaces.h:110
a KeyedDictionary that gives the address of the smallest key not smaller than the one asked,...
Definition SetInterfaces.h:123
DictionarySet< RedBlackTree< T, bool > > TreeSet
the set on a Red-Black tree
Definition DictionarySet.h:203
DictionarySet< OpenHashTable< T, bool, H > > OpenHashSet
the set on a hash table with open addressing
Definition DictionarySet.h:199
DictionarySet< ChainedHashTable< T, bool, Chain::FRONT, H > > ChainedHashSet
the set on a hash table with lists of overflow
Definition DictionarySet.h:194