alternative Standard Libary  0.29.8
std::stack< T, TAllocator, TContainer > Template-Klassenreferenz

#include <stack.hpp>

Öffentliche Typen

using container_type = TContainer
 
using value_type = TContainer::value_type
 
using size_type = TContainer::size_type
 
using allocator_type = TAllocator
 

Öffentliche Methoden

 stack (const allocator_type &allocator=allocator_type())
 
 stack (const stack &rhs, const allocator_type &allocator=allocator_type())
 
 stack (e_noinitialize n)
 
stackoperator= (const stack &rhs)
 
void push (const value_type &v)
 
void pop ()
 
value_typetop ()
 
const value_typetop () const
 
void clear ()
 
bool empty () const
 
size_type size () const
 
const allocator_typeget_allocator () const
 
void set_allocator (const allocator_type &allocator)
 

Ausführliche Beschreibung

template<typename T, class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
class std::stack< T, TAllocator, TContainer >

Dokumentation der benutzerdefinierten Datentypen

◆ allocator_type

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
using std::stack< T, TAllocator, TContainer >::allocator_type = TAllocator

◆ container_type

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
using std::stack< T, TAllocator, TContainer >::container_type = TContainer

◆ size_type

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
using std::stack< T, TAllocator, TContainer >::size_type = TContainer::size_type

◆ value_type

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
using std::stack< T, TAllocator, TContainer >::value_type = TContainer::value_type

Beschreibung der Konstruktoren und Destruktoren

◆ stack() [1/3]

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
std::stack< T, TAllocator, TContainer >::stack ( const allocator_type allocator = allocator_type())
inlineexplicit
49  : m_container(allocator)
50  {
51  }

◆ stack() [2/3]

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
std::stack< T, TAllocator, TContainer >::stack ( const stack< T, TAllocator, TContainer > &  rhs,
const allocator_type allocator = allocator_type() 
)
inline
53  : m_container(rhs, allocator)
54  {
55  }

◆ stack() [3/3]

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
std::stack< T, TAllocator, TContainer >::stack ( e_noinitialize  n)
inlineexplicit
57  : m_container(n)
58  {
59  }

Dokumentation der Elementfunktionen

◆ clear()

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
void std::stack< T, TAllocator, TContainer >::clear ( )
inline
88  {
89  m_container.clear();
90  }

◆ empty()

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
bool std::stack< T, TAllocator, TContainer >::empty ( ) const
inline
93  {
94  return m_container.empty();
95  }

◆ get_allocator()

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
const allocator_type& std::stack< T, TAllocator, TContainer >::get_allocator ( ) const
inline
101  {
102  return m_container.get_allocator();
103  }

◆ operator=()

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
stack& std::stack< T, TAllocator, TContainer >::operator= ( const stack< T, TAllocator, TContainer > &  rhs)
inline
61  {
62  if (&rhs != this)
63  {
64  m_container = rhs.m_container;
65  }
66  return *this;
67  }

◆ pop()

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
void std::stack< T, TAllocator, TContainer >::pop ( )
inline
74  {
75  m_container.pop_back();
76  }

◆ push()

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
void std::stack< T, TAllocator, TContainer >::push ( const value_type v)
inline
70  {
71  m_container.push_back(v);
72  }

◆ set_allocator()

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
void std::stack< T, TAllocator, TContainer >::set_allocator ( const allocator_type allocator)
inline
105  {
106  m_container.set_allocator(allocator);
107  }

◆ size()

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
size_type std::stack< T, TAllocator, TContainer >::size ( ) const
inline
97  {
98  return m_container.size();
99  }

◆ top() [1/2]

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
value_type& std::stack< T, TAllocator, TContainer >::top ( )
inline
78  {
79  return m_container.back();
80  }

◆ top() [2/2]

template<typename T , class TAllocator = std::allocator, class TContainer = std::vector<T, TAllocator>>
const value_type& std::stack< T, TAllocator, TContainer >::top ( ) const
inline
82  {
83  return m_container.back();
84  }

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: