Data Structures & Algorithms in C++
Goodrich, Tamassia, Mount and Goldwasser
Loading...
Searching...
No Matches
Public Member Functions
dsac::stackqueue::queue< T, Container > Class Template Reference

A simplified version of the STL queue class. More...

#include <queue.h>

Collaboration diagram for dsac::stackqueue::queue< T, Container >:
Collaboration graph

Public Member Functions

int size () const
 return the number of elements currently in the queue
 
bool empty () const
 return whether the queue is currently empty
 
const T & front () const
 return const reference to the first element of the queue
 
T & front ()
 return live (non-const) reference to the first element of the queue
 
const T & back () const
 return const reference to the last element of the queue
 
T & back ()
 return live (non-const) reference to the last element of the queue
 
void push (const T &elem)
 add an element to the back of the queue
 
void pop ()
 remove the first element from the queue
 

Detailed Description

template<typename T, typename Container = std::deque<T>>
class dsac::stackqueue::queue< T, Container >

A simplified version of the STL queue class.

Member Function Documentation

◆ back() [1/2]

template<typename T , typename Container = std::deque<T>>
T & dsac::stackqueue::queue< T, Container >::back ( )
inline

return live (non-const) reference to the last element of the queue

◆ back() [2/2]

template<typename T , typename Container = std::deque<T>>
const T & dsac::stackqueue::queue< T, Container >::back ( ) const
inline

return const reference to the last element of the queue

◆ empty()

template<typename T , typename Container = std::deque<T>>
bool dsac::stackqueue::queue< T, Container >::empty ( ) const
inline

return whether the queue is currently empty

◆ front() [1/2]

template<typename T , typename Container = std::deque<T>>
T & dsac::stackqueue::queue< T, Container >::front ( )
inline

return live (non-const) reference to the first element of the queue

◆ front() [2/2]

template<typename T , typename Container = std::deque<T>>
const T & dsac::stackqueue::queue< T, Container >::front ( ) const
inline

return const reference to the first element of the queue

◆ pop()

template<typename T , typename Container = std::deque<T>>
void dsac::stackqueue::queue< T, Container >::pop ( )
inline

remove the first element from the queue

◆ push()

template<typename T , typename Container = std::deque<T>>
void dsac::stackqueue::queue< T, Container >::push ( const T &  elem)
inline

add an element to the back of the queue

◆ size()

template<typename T , typename Container = std::deque<T>>
int dsac::stackqueue::queue< T, Container >::size ( ) const
inline

return the number of elements currently in the queue


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