Template Class QueueWithArraySTL

Class Documentation

template<typename T>
class QueueWithArraySTL

Queue with STL array class with all releated functionality.

Template Parameters:

T – The type of the implementation class.

Public Functions

inline QueueWithArraySTL()

Default constructor for the QueueWithArray class to intialize the internal deque to an empty deque.

inline void push(const T &element)

Pushes the element at the back of the queue.

Parameters:

element – The element to be pushed.

inline T pop()

Pops an element from the front of the queue and returns its value.

Throws:

std::out_of_range – stating that “Queue is empty”.

Returns:

val The value of the popped element.

inline T peek() const

Gets the value of the element at the front of the queue.

Throws:

std::out_of_range – stating that “Queue is empty”.

Returns:

The value of the element at the front of the queue.

inline size_t size() const

Gets the current size of the queue.

Returns:

The current size of the queue.