35#ifndef __ADS_ArrayStack
36 #define __ADS_ArrayStack
85 [[nodiscard]]
bool empty(
void )
const;
89 [[nodiscard]]
const T &
top(
void )
const;
119 [[nodiscard]] std::size_t
size(
void )
const;
145 return( f_A.get() + f_size );
156 std::unique_ptr< T[] > f_A;
158 std::size_t f_capacity;
170#include "ADS/stack/impl/ArrayStack.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
std::size_t size_type
the type of the sizes
Definition ArrayStack.h:133
const T & reference
a constant reference
Definition ArrayStack.h:135
const_iterator cend(void) const
as end()
Definition ArrayStack.h:152
std::size_t capacity(void) const
the maximum number of items,
ArrayStack & operator=(ArrayStack other) noexcept
the items of other, by copy and swap
const_iterator end(void) const
the iterator past the item on top
Definition ArrayStack.h:144
bool operator==(const ArrayStack &o) const
the same items in the same order, whatever the capacities
T value_type
the type of the items
Definition ArrayStack.h:132
void push(const T &v)
puts on top
const T * const_iterator
a constant iterator
Definition ArrayStack.h:138
T pop(void)
removes the item on top and returns it
ArrayStack(std::size_t dim)
the empty stack of at most items
const T * iterator
a constant iterator
Definition ArrayStack.h:137
ArrayStack(ArrayStack &&other) noexcept
the items of other, which is left empty with no capacity
bool empty(void) const
true if there is no item, i.e.,
const T & top(void) const
the item on top,
ArrayStack(const ArrayStack &other)
a copy of other, item by item
void swap(ArrayStack &other) noexcept
exchanges the items and the capacities with other
std::ptrdiff_t difference_type
the type of the distances
Definition ArrayStack.h:134
T Item
the type of the items
Definition ArrayStack.h:67
const_iterator begin(void) const
the iterator on the item at the bottom
Definition ArrayStack.h:141
std::size_t size(void) const
the number of items,
const T & const_reference
a constant reference
Definition ArrayStack.h:136
const_iterator cbegin(void) const
as begin()
Definition ArrayStack.h:149