Template Class SequenceStack

Class Documentation

template<Sequence S>
class SequenceStack

a STACK simulated with the operations of a SEQUENCE S, the top first

Public Types

using Item = typename S::Item

the type of the items

Public Functions

bool empty(void) const
const Item &top(void) const

the item on top, read( head() )

Pre:

the stack is not empty

Item pop(void)

removes the item on top and returns it, remove( head() )

Pre:

the stack is not empty

void push(const Item &v)

puts v on top, insert( head() , v )

Post:

the stack is not empty, v on top

bool operator==(const SequenceStack &o) const = default

the same items in the same order, those of the sequences

inline auto begin(void) const
inline auto end(void) const