From d34c31e791e190d9c1e2033b9edf2a44ce510d15 Mon Sep 17 00:00:00 2001 From: Raymond Degbe Date: Thu, 24 Mar 2022 00:35:43 +0000 Subject: [PATCH 1/2] Add .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dbe9c82 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode/ \ No newline at end of file From 7f6069b824d22c502764239c99cf0cd220f321c7 Mon Sep 17 00:00:00 2001 From: Raymond Degbe Date: Thu, 24 Mar 2022 11:30:11 +0000 Subject: [PATCH 2/2] Made virtual int _id() function return const Since the function does no modification to the id variable it returns, I feel it is a good practice in c++ to make it return const --- src/main/cpp/algorithms/datastructures/stack/Stack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/cpp/algorithms/datastructures/stack/Stack.h b/src/main/cpp/algorithms/datastructures/stack/Stack.h index 2758e83..a1ba8f9 100644 --- a/src/main/cpp/algorithms/datastructures/stack/Stack.h +++ b/src/main/cpp/algorithms/datastructures/stack/Stack.h @@ -42,7 +42,7 @@ class Stack virtual ~Stack() {} // return the ID the stack implementation - virtual int id() { return id_; } + virtual int id() const { return id_; } // return the number of elements in the stack virtual int size() = 0;