kblib 0.2.3
General utilities library for modern C++
kblib::stack< T, Container > Class Template Reference

#include <kblib/containers.h>

Public Types

using container_type = Container
 
using value_type = typename Container::value_type
 
using size_type = typename Container::size_type
 
using reference = typename Container::reference
 
using const_reference = typename Container::const_reference
 

Public Member Functions

 stack ()
 
 stack (const Container &cont)
 
template<typename Alloc , typename std::enable_if< std::uses_allocator< container_type, Alloc >::value, int >::type = 0>
 stack (const Alloc &alloc)
 
template<typename Alloc , typename std::enable_if< std::uses_allocator< container_type, Alloc >::value, int >::type = 0>
 stack (const Container &cont, const Alloc &alloc)
 
template<typename Alloc , typename std::enable_if< std::uses_allocator< container_type, Alloc >::value, int >::type = 0>
 stack (Container &&cont, const Alloc &alloc)
 
template<typename Alloc , typename std::enable_if< std::uses_allocator< container_type, Alloc >::value, int >::type = 0>
 stack (const stack &cont, const Alloc &alloc)
 
template<typename Alloc , typename std::enable_if< std::uses_allocator< container_type, Alloc >::value, int >::type = 0>
 stack (stack &&cont, const Alloc &alloc)
 
auto top () &noexcept(noexcept(backing.back())) -> reference
 
auto top () const &noexcept(noexcept(backing.back())) -> const_reference
 
auto empty () const noexcept -> bool
 
auto size () const noexcept -> size_type
 
auto push (const value_type &value) -> decltype(auto)
 
auto push (value_type &&value) -> decltype(auto)
 
template<typename... Args>
auto emplace (Args &&... args) &-> decltype(auto)
 
auto pop () noexcept(noexcept(backing.pop_back())) -> void
 
auto clear () noexcept(noexcept(backing.clear())) -> void
 
auto swap (stack &other) noexcept(fakestd::is_nothrow_swappable< Container >::value) -> void
 
auto container () const &-> container_type &
 
auto container () &-> container_type &
 
auto container () &&-> container_type
 

Detailed Description

template<typename T, typename Container = std::vector<T>>
class kblib::stack< T, Container >

Definition at line 373 of file containers.h.

Member Typedef Documentation

◆ const_reference

template<typename T , typename Container = std::vector<T>>
using kblib::stack< T, Container >::const_reference = typename Container::const_reference

Definition at line 381 of file containers.h.

◆ container_type

template<typename T , typename Container = std::vector<T>>
using kblib::stack< T, Container >::container_type = Container

Definition at line 377 of file containers.h.

◆ reference

template<typename T , typename Container = std::vector<T>>
using kblib::stack< T, Container >::reference = typename Container::reference

Definition at line 380 of file containers.h.

◆ size_type

template<typename T , typename Container = std::vector<T>>
using kblib::stack< T, Container >::size_type = typename Container::size_type

Definition at line 379 of file containers.h.

◆ value_type

template<typename T , typename Container = std::vector<T>>
using kblib::stack< T, Container >::value_type = typename Container::value_type

Definition at line 378 of file containers.h.

Constructor & Destructor Documentation

◆ stack() [1/7]

template<typename T , typename Container = std::vector<T>>
kblib::stack< T, Container >::stack ( )
inline

Definition at line 392 of file containers.h.

◆ stack() [2/7]

template<typename T , typename Container = std::vector<T>>
kblib::stack< T, Container >::stack ( const Container &  cont)
inlineexplicit

Definition at line 394 of file containers.h.

◆ stack() [3/7]

template<typename T , typename Container = std::vector<T>>
template<typename Alloc , typename std::enable_if< std::uses_allocator< container_type, Alloc >::value, int >::type = 0>
kblib::stack< T, Container >::stack ( const Alloc &  alloc)
explicit

◆ stack() [4/7]

template<typename T , typename Container = std::vector<T>>
template<typename Alloc , typename std::enable_if< std::uses_allocator< container_type, Alloc >::value, int >::type = 0>
kblib::stack< T, Container >::stack ( const Container &  cont,
const Alloc &  alloc 
)

◆ stack() [5/7]

template<typename T , typename Container = std::vector<T>>
template<typename Alloc , typename std::enable_if< std::uses_allocator< container_type, Alloc >::value, int >::type = 0>
kblib::stack< T, Container >::stack ( Container &&  cont,
const Alloc &  alloc 
)

◆ stack() [6/7]

template<typename T , typename Container = std::vector<T>>
template<typename Alloc , typename std::enable_if< std::uses_allocator< container_type, Alloc >::value, int >::type = 0>
kblib::stack< T, Container >::stack ( const stack< T, Container > &  cont,
const Alloc &  alloc 
)

◆ stack() [7/7]

template<typename T , typename Container = std::vector<T>>
template<typename Alloc , typename std::enable_if< std::uses_allocator< container_type, Alloc >::value, int >::type = 0>
kblib::stack< T, Container >::stack ( stack< T, Container > &&  cont,
const Alloc &  alloc 
)

Member Function Documentation

◆ clear()

template<typename T , typename Container = std::vector<T>>
auto kblib::stack< T, Container >::clear ( ) -> void
inlinenoexcept

Definition at line 458 of file containers.h.

◆ container() [1/3]

template<typename T , typename Container = std::vector<T>>
auto kblib::stack< T, Container >::container ( ) && -> container_type
inline

Definition at line 476 of file containers.h.

◆ container() [2/3]

template<typename T , typename Container = std::vector<T>>
auto kblib::stack< T, Container >::container ( ) & -> container_type&
inline

Definition at line 474 of file containers.h.

◆ container() [3/3]

template<typename T , typename Container = std::vector<T>>
auto kblib::stack< T, Container >::container ( ) const & -> container_type&
inline

Definition at line 473 of file containers.h.

◆ emplace()

template<typename T , typename Container = std::vector<T>>
template<typename... Args>
auto kblib::stack< T, Container >::emplace ( Args &&...  args) & -> decltype(auto)
inline

Definition at line 450 of file containers.h.

◆ empty()

template<typename T , typename Container = std::vector<T>>
auto kblib::stack< T, Container >::empty ( ) const -> bool
inlinenoexcept

Definition at line 435 of file containers.h.

◆ pop()

template<typename T , typename Container = std::vector<T>>
auto kblib::stack< T, Container >::pop ( ) -> void
inlinenoexcept

Definition at line 454 of file containers.h.

◆ push() [1/2]

template<typename T , typename Container = std::vector<T>>
auto kblib::stack< T, Container >::push ( const value_type value) -> decltype(auto)
inline

Definition at line 442 of file containers.h.

◆ push() [2/2]

template<typename T , typename Container = std::vector<T>>
auto kblib::stack< T, Container >::push ( value_type &&  value) -> decltype(auto)
inline

Definition at line 445 of file containers.h.

◆ size()

template<typename T , typename Container = std::vector<T>>
auto kblib::stack< T, Container >::size ( ) const -> size_type
inlinenoexcept

Definition at line 436 of file containers.h.

◆ swap()

template<typename T , typename Container = std::vector<T>>
auto kblib::stack< T, Container >::swap ( stack< T, Container > &  other) -> void
inlinenoexcept

Definition at line 463 of file containers.h.

◆ top() [1/2]

template<typename T , typename Container = std::vector<T>>
auto kblib::stack< T, Container >::top ( ) & -> reference
inlinenoexcept

Definition at line 425 of file containers.h.

◆ top() [2/2]

template<typename T , typename Container = std::vector<T>>
auto kblib::stack< T, Container >::top ( ) const & -> const_reference
inlinenoexcept

Definition at line 428 of file containers.h.


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