numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Class of stacks using static arrays. More...
#include <num_collect/util/static_stack.h>
Public Member Functions | |
static_stack () | |
Constructor. | |
static_stack (const static_stack &)=delete | |
static_stack (static_stack &&)=delete | |
~static_stack () | |
Destructor. | |
auto | empty () const noexcept -> bool |
Check whether this stack is empty. | |
auto | operator= (const static_stack &) -> static_stack &=delete |
auto | operator= (static_stack &&) -> static_stack &=delete |
void | pop () noexcept |
Pop a value. | |
void | push (const T &value) |
Push a value. | |
auto | size () const noexcept -> std::size_t |
Get the current number of values. | |
auto | top () const noexcept -> const T & |
Get the top value. | |
auto | top () noexcept -> T & |
Get the top value. | |
Private Attributes | |
T * | begin_ |
Pointer to the first element in the buffer. | |
char | buffer_ [sizeof(T[StaticArraySize])] {} |
Buffer for stack. | |
T * | end_ |
Pointer to the past-the-end element in the buffer. | |
T * | storage_end_ |
Pointer to the past-the-end storage in the buffer. | |
Class of stacks using static arrays.
T | Type of values in the stack. |
StaticArraySize | Size of the static array for the stack. |
Definition at line 40 of file static_stack.h.
|
inline |
Constructor.
Definition at line 45 of file static_stack.h.
|
inline |
Destructor.
Definition at line 59 of file static_stack.h.
|
inlinenodiscardnoexcept |
Check whether this stack is empty.
true | This stack is empty. |
false | This stack is not empty. |
Definition at line 104 of file static_stack.h.
|
inlinenoexcept |
Pop a value.
Definition at line 79 of file static_stack.h.
|
inline |
|
inlinenodiscardnoexcept |
Get the current number of values.
Definition at line 111 of file static_stack.h.
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
private |
Pointer to the first element in the buffer.
Definition at line 120 of file static_stack.h.
|
private |
Buffer for stack.
Definition at line 117 of file static_stack.h.
|
private |
Pointer to the past-the-end element in the buffer.
Definition at line 123 of file static_stack.h.
|
private |
Pointer to the past-the-end storage in the buffer.
Definition at line 126 of file static_stack.h.