From 16db1473f2de99a868a9fea11d965f929f537391 Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Tue, 6 Feb 2024 13:25:19 -0500 Subject: [PATCH] adding lab 5 discussion --- labs/discussions/vectors.txt | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 labs/discussions/vectors.txt diff --git a/labs/discussions/vectors.txt b/labs/discussions/vectors.txt new file mode 100644 index 0000000..9217d44 --- /dev/null +++ b/labs/discussions/vectors.txt @@ -0,0 +1,9 @@ +In-class discussion + +Discuss the following questions with students around you. + +1. What is the difference between a member function and a non-member function? +2. For a templated class, should the member function be defined within the .h file? should the non-member function be defined within the same .h file? + +3. Can we use subscripting (i.e., v[i]) to access this vector and hence remove elements from this vector? +4. Erasing elements from a vector could invalidate iterators, how would this affect our program and how should we deal with this?