63template< std::equality_comparable T >
75 ListSet( std::initializer_list< T > items );
78 [[nodiscard]] std::size_t
size(
void )
const;
81 [[nodiscard]]
bool empty(
void )
const;
85 [[nodiscard]]
bool contains(
const T & x )
const;
123 [[nodiscard]] std::optional< T >
min(
void )
const
124 requires std::totally_ordered< T >;
157 [[nodiscard]]
bool distinct(
void )
const;
160 std::size_t f_size = 0;
241#include "ADS/set/impl/ListSet.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The LIST of the book: a SEQUENCE [see ADT.h] realized as a bidirectional circular list of cells with ...
The operations of chapter 8 on any SET that can be copied and has the foreach, forEach( f ): the unio...
a set as an unsorted list
Definition ListSet.h:65
const T & reference
a constant reference
Definition ListSet.h:137
const_iterator iterator
the same, constant
Definition ListSet.h:141
const T & const_reference
a constant reference
Definition ListSet.h:138
const_iterator cend(void) const
as end()
Definition ListSet.h:150
std::size_t size_type
the sizes
Definition ListSet.h:135
const_iterator begin(void) const
the iterator on the item at the head of the list
Definition ListSet.h:144
bool contains(const T &x) const
whether is in the set, by a scan of the list, time
typename List< T >::const_iterator const_iterator
the iterator of the list, constant
Definition ListSet.h:140
bool empty(void) const
whether the set has no item
const_iterator cbegin(void) const
as begin()
Definition ListSet.h:148
const_iterator end(void) const
the iterator past the last item
Definition ListSet.h:146
std::size_t size(void) const
the number of items
std::ptrdiff_t difference_type
the distances
Definition ListSet.h:136
void insert(const T &x)
into the set, time, for the check that is not there
void forEach(F &&f) const
f( x ) on the items, from the last inserted, time
void remove(const T &x)
out of the set, time
std::optional< T > min(void) const
the smallest item, none if the set is empty, by a scan, time
T Item
the type of the items
Definition ListSet.h:69
void insertNew(const T &x)
, which must not be there, at the head of the list, time
ListSet(void)=default
the empty set
T value_type
the items
Definition ListSet.h:134
ListSet(std::initializer_list< T > items)
the set of the given items, a repeated one taken once
a SEQUENCE realized as a bidirectional circular list with a sentinel, its cells from a pool if Pooled
Definition List.h:118
Iterator< true > const_iterator
the iterator on the constant items
Definition List.h:324
Cell * Pos
a position is the address of a cell
Definition List.h:132
BoolSet setIntersection(const BoolSet &A, const BoolSet &B)
the intersection, a set of dimension
BoolSet setUnion(const BoolSet &A, const BoolSet &B)
the union, a set of dimension
BoolSet setDifference(const BoolSet &A, const BoolSet &B)
the difference, a set of dimension A.dim()
BoolSet setSymmetricDifference(const BoolSet &A, const BoolSet &B)
the symmetric difference, the items in exactly one of and , a set of dimension