RADLib
RADical C++ application framework
RADData::RADStack< T, Alloc > Class Template Reference

LIFO stack adapter backed by RADVector. More...

#include <RADDataStructures.h>

Public Member Functions

bool empty () const noexcept
 Returns true when the stack is empty. More...
 
size_t size () const noexcept
 Returns number of stacked elements. More...
 
T & top () noexcept
 Returns the top element. More...
 
const T & top () const noexcept
 Returns the top element. More...
 
void push (const T &value)
 Pushes a copy onto the stack. More...
 
void push (T &&value)
 Pushes a moved value onto the stack. More...
 
template<typename... Args>
T & emplace (Args &&... args)
 Constructs an element on top of the stack. More...
 
void pop ()
 Removes the top element. More...
 
void clear ()
 Removes all elements. More...
 

Detailed Description

template<typename T, typename Alloc = std::allocator<T>>
class RADData::RADStack< T, Alloc >

LIFO stack adapter backed by RADVector.

Member Function Documentation

◆ clear()

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADStack< T, Alloc >::clear ( )
inline

Removes all elements.

◆ emplace()

template<typename T , typename Alloc = std::allocator<T>>
template<typename... Args>
T& RADData::RADStack< T, Alloc >::emplace ( Args &&...  args)
inline

Constructs an element on top of the stack.

◆ empty()

template<typename T , typename Alloc = std::allocator<T>>
bool RADData::RADStack< T, Alloc >::empty ( ) const
inlinenoexcept

Returns true when the stack is empty.

◆ pop()

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADStack< T, Alloc >::pop ( )
inline

Removes the top element.

◆ push() [1/2]

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADStack< T, Alloc >::push ( const T &  value)
inline

Pushes a copy onto the stack.

◆ push() [2/2]

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADStack< T, Alloc >::push ( T &&  value)
inline

Pushes a moved value onto the stack.

◆ size()

template<typename T , typename Alloc = std::allocator<T>>
size_t RADData::RADStack< T, Alloc >::size ( ) const
inlinenoexcept

Returns number of stacked elements.

◆ top() [1/2]

template<typename T , typename Alloc = std::allocator<T>>
const T& RADData::RADStack< T, Alloc >::top ( ) const
inlinenoexcept

Returns the top element.

◆ top() [2/2]

template<typename T , typename Alloc = std::allocator<T>>
T& RADData::RADStack< T, Alloc >::top ( )
inlinenoexcept

Returns the top element.


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