35#ifndef __ADS_SortedListSet
36 #define __ADS_SortedListSet
68template< std::totally_ordered T >
83 [[nodiscard]] std::size_t
size(
void )
const;
86 [[nodiscard]]
bool empty(
void )
const;
90 [[nodiscard]]
bool contains(
const T & x )
const;
131 [[nodiscard]] std::optional< T >
min(
void )
const;
135 [[nodiscard]] std::optional< T >
max(
void )
const;
172 [[nodiscard]]
bool sorted(
void )
const;
175 std::size_t f_size = 0;
281#include "ADS/set/impl/SortedListSet.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 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
a set as a list sorted in increasing order
Definition SortedListSet.h:70
bool empty(void) const
whether the set has no item
bool contains(const T &x) const
whether is in the set, by a scan that stops at the first item not smaller than , time
T value_type
the items
Definition SortedListSet.h:148
void insertLast(const T &x)
, larger than all the items, at the end of the list, time
SortedListSet(void)=default
the empty set
const_iterator end(void) const
the iterator past the largest item
Definition SortedListSet.h:160
const_iterator begin(void) const
the iterator on the smallest item
Definition SortedListSet.h:158
const T & reference
a constant reference
Definition SortedListSet.h:151
void remove(const T &x)
out of the set, time
SortedListSet(std::initializer_list< T > items)
the set of the given items, in any order, a repeated one taken once
std::optional< T > min(void) const
the smallest item, at the head, none if the set is empty, time
T Item
the type of the items
Definition SortedListSet.h:74
std::size_t size(void) const
the number of items
typename List< T >::const_iterator const_iterator
the iterator of the list, constant
Definition SortedListSet.h:154
std::size_t size_type
the sizes
Definition SortedListSet.h:149
std::ptrdiff_t difference_type
the distances
Definition SortedListSet.h:150
const_iterator iterator
the same, constant
Definition SortedListSet.h:155
const_iterator cend(void) const
as end()
Definition SortedListSet.h:164
const_iterator cbegin(void) const
as begin()
Definition SortedListSet.h:162
const T & const_reference
a constant reference
Definition SortedListSet.h:152
std::optional< T > max(void) const
the largest item, at the tail, none if the set is empty, time
void forEach(F &&f) const
f( x ) on the items in increasing order, time
void insert(const T &x)
into the set, time, to keep the order
const List< T > & list(void) const
the sorted list of the items
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
SortedListSet< T > merge(const SortedListSet< T > &A, const SortedListSet< T > &B, bool a, bool b, bool both)
the merge of the sorted lists of and : an item of only, of only or of both goes into the result if...