diff options
author | Santo Cariotti <dcariotti24@gmail.com> | 2020-05-13 20:21:54 +0200 |
---|---|---|
committer | Santo Cariotti <dcariotti24@gmail.com> | 2020-05-13 20:21:54 +0200 |
commit | e2e7a2e4fa6e50397da79da9cb8c2aec76779575 (patch) | |
tree | fa2e8654b759c3eb2b274c2751f02299d2f48c95 /I_anno/Programmazione_2/data_structures/stack.cc | |
parent | 0d2341999a9c844954aca9ed4cc739b8fde34584 (diff) |
fix: improve code quality for data structures
Diffstat (limited to 'I_anno/Programmazione_2/data_structures/stack.cc')
-rw-r--r-- | I_anno/Programmazione_2/data_structures/stack.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/I_anno/Programmazione_2/data_structures/stack.cc b/I_anno/Programmazione_2/data_structures/stack.cc index efdb939..400039d 100644 --- a/I_anno/Programmazione_2/data_structures/stack.cc +++ b/I_anno/Programmazione_2/data_structures/stack.cc @@ -12,6 +12,7 @@ template<class T> class stack { public: stack() : _head{nullptr} {} + ~stack() { auto iter = _head; while(iter) { @@ -19,6 +20,7 @@ public: iter = iter->next; } } + stack<T>* push(T val) { if(!_head) { |