-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.h
More file actions
46 lines (35 loc) · 641 Bytes
/
stack.h
File metadata and controls
46 lines (35 loc) · 641 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
#ifndef STACK_H
#define STACK_K
#include "list.h"
template <typename T>
class Stack : private List<T>
{
public:
Stack();
Stack(const T& data);
bool pop();
void push(const T& data);
void print() const override;
};
template <typename T>
Stack<T>::Stack() { }
template <typename T>
Stack<T>::Stack(const T& data)
{
}
template <typename T>
bool Stack<T>::pop()
{
return this->remove_front();
}
template <typename T>
void Stack<T>::push(const T& value)
{
this->insert_front(value);
}
template <typename T>
void Stack<T>::print() const
{
List<T>::print();
}
#endif //STACK_H