ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::Sequence Concept Reference

SEQUENCE (section 3.2.1): a dynamic linear sequence of items; as axioms, \( \mathrm{empty}( s ) = \mathrm{finished}( \mathrm{head}( s ) ) \) (empty() is redundant), \( \mathrm{read}( \mathrm{insert}( p , v ) ) = v \), \( \mathrm{remove}( \mathrm{insert}( p , v ) ) = s \), and \( \mathrm{read}( \mathrm{write}( p , v ) ) = v \) with the other items unchanged. More...

#include <ADS/ADT.h>

Concept definition

template< class S >
concept Sequence =
requires( S s , const S cs , typename S::Pos p , const typename S::Item & v )
{
typename S::Item;
typename S::Pos;
{ cs.empty() } -> std::same_as< bool >;
{ cs.finished( p ) } -> std::same_as< bool >;
{ cs.head() } -> std::same_as< typename S::Pos >;
{ cs.tail() } -> std::same_as< typename S::Pos >;
{ cs.next( p ) } -> std::same_as< typename S::Pos >;
{ cs.prev( p ) } -> std::same_as< typename S::Pos >;
{ s.insert( p , v ) } -> std::same_as< typename S::Pos >;
{ s.remove( p ) } -> std::same_as< typename S::Pos >;
{ cs.read( p ) } -> std::convertible_to< typename S::Item >;
s.write( p , v );
}
SEQUENCE (section 3.2.1): a dynamic linear sequence of items; as axioms, (empty() is redundant),...
Definition ADT.h:111

Detailed description

SEQUENCE (section 3.2.1): a dynamic linear sequence of items; as axioms, \( \mathrm{empty}( s ) = \mathrm{finished}( \mathrm{head}( s ) ) \) (empty() is redundant), \( \mathrm{read}( \mathrm{insert}( p , v ) ) = v \), \( \mathrm{remove}( \mathrm{insert}( p , v ) ) = s \), and \( \mathrm{read}( \mathrm{write}( p , v ) ) = v \) with the other items unchanged.