-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.h
More file actions
48 lines (38 loc) · 989 Bytes
/
stack.h
File metadata and controls
48 lines (38 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/** \file stack.h
* \author Andrej Leban
* \date 4/2018
*/
#ifndef STACK_H
#define STACK_H
#include <stack>
namespace cm {
//! \brief The Stack class
//! A std::stack that exposes the underlying container.
template< class T, class Container = std::deque<T>>
class Stack : public std::stack<T,Container>
{
public:
using super = std::stack<T,Container>;
using super::stack;
~Stack() = default;
Stack( const Stack & ) = default;
Stack( Stack && ) noexcept = default;
using super::operator=;
Stack & operator=( const Stack & p_rhs )
{
super::operator=( static_cast<const super &>( p_rhs) );
m_c = super::c;
return *this;
}
Stack & operator=( Stack && p_rhs ) noexcept
{
super::operator=( std::forward<super>( p_rhs) );
m_c = super::c;
return *this;
}
// expose container
//! \brief The exposed container.
Container & m_c = super::c;
};
} // namespace cm
#endif // STACK_H