ScapeGoatTree
Loading...
Searching...
No Matches
Stack< T > Class Template Reference

#include <stack.hpp>

Public Member Functions

void push (const T &value)
 
T pop ()
 
T top ()
 
unsigned int size () const
 
bool isEmpty () const
 

Private Attributes

Vector< Tdata
 

Member Function Documentation

◆ isEmpty()

template<typename T >
bool Stack< T >::isEmpty ( ) const
inline

Checks if the stack is empty.

◆ pop()

template<typename T >
T Stack< T >::pop ( )
inline

Removes and returns the top element from the stack. Throws std::out_of_range if the stack is empty.

◆ push()

template<typename T >
void Stack< T >::push ( const T value)
inline

Pushes a new element onto the stack.

◆ size()

template<typename T >
unsigned int Stack< T >::size ( ) const
inline

Returns the number of elements currently in the stack.

◆ top()

template<typename T >
T Stack< T >::top ( )
inline

Member Data Documentation

◆ data

template<typename T >
Vector<T> Stack< T >::data
private

The documentation for this class was generated from the following file: