From e2e7a2e4fa6e50397da79da9cb8c2aec76779575 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Wed, 13 May 2020 20:21:54 +0200 Subject: fix: improve code quality for data structures --- I_anno/Programmazione_2/data_structures/stack.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'I_anno/Programmazione_2/data_structures/stack.cc') 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 stack { public: stack() : _head{nullptr} {} + ~stack() { auto iter = _head; while(iter) { @@ -19,6 +20,7 @@ public: iter = iter->next; } } + stack* push(T val) { if(!_head) { -- cgit v1.2.3-18-g5258