Stack


A sequential access container, the abstract data type stack.

Implemented via circular list. For iteration see Iterator.

Library

ETL<ToolKit>

Declaration


#include<ospace/advanced/Stack.h>

template
  <
  class Instantiator
  >
class os_Stack

Interface

Constructor
os_Stack(void)
This the default constructor.
Destructor
~os_Stack()
Destroys all entries in the stack.
operator =
os_Stack<T>& operator=(const os_Stack<T>&)
Replaces contents of one stack with another..
operator ==
int operator==(const os_Stack<T>&)
Returns 1 (true) if two stacks contain items that are equal to one another, otherwise returns 0 (false).
operator !=
int operator!=(const os_Stack<T>&)
The negation of operator==, above.
operator +=
os_Stack<T>& operator+=(const os_Stack<T>& s)
Appends stack s, making a bigger stack .
make_empty
os_Stack& make_empty(void)
Removes and destroys the contents. The stack is in state of initial construction.
Size
unsigned int Size(void)
Returns the number of items in the stack.
push
os_Stack<T>& push(const T& item)
Adds the item to the stack (push operation).
pop
T& pop(void)
Removes and returns the item at top of stack.
top
T& top(void)
Returns a reference to the top of stack without removing it.
remove
os_Stack<T>& remove(T& item)
Removes item, if it is in the stack.

Copyright©2005-2026 Recursion Software LLC
All Rights Reserved - For use by licensed users only.