Skip to content

stack.h

Baptiste Thémine edited this page Jul 5, 2020 · 8 revisions
#include <JLC/stack.h>

Description

Definition of LIFO container class extending Collection.

LIFO = Last In First Out. A stack is a constrained set of elements similar to a list but provides a subset of setter methods (stack::push and stack::pop) and gives only access to its last element. Zero-sized stacks are valid but cannot be dereferenced. Once modifications are completed, a stack can then be transformed into a stream to perform search and sorting operations.

Requirements

  • (Mandatory) <cstdio>, <cstdlib>, <iostream>, <iterator>, <stdexcept>, <JLC/debug.h>, <JLC/functions.h> and <JLC/collection.h> must be included.
  • (Optional) <functional> and <initializer_list> provide additional features from C++11.

Content

Name Description
class Stack Defines the class Stack and provides stack methods.
namespace stack Defines the namespace stack and provides types, constants, exceptions and utility functions for stack manipulation.

See also

Clone this wiki locally