From 3e18159388acecd1ae5d03b0d7ae318c7c6b8ded Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Tue, 6 Feb 2024 00:40:22 -0500 Subject: [PATCH] make it italic --- labs/05_vectors/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/labs/05_vectors/README.md b/labs/05_vectors/README.md index 10ea3a3..4bfba44 100644 --- a/labs/05_vectors/README.md +++ b/labs/05_vectors/README.md @@ -167,13 +167,13 @@ Add several test cases to test_vec.cpp to show that the function works as expect notation of your solution in terms of n the size of the vector, and e the number of occurences of the input element in the vector? -*Note*: when you are in a non-member function, and you want to use the iterator, which is a member type of the Vec<T> class, you have to use the typename keyword before the Vec<T>:: scope. For example, if you want to define an iterator named *itr*, you can do it like this: +*Note*: when you are in a non-member function, and you want to use the iterator, which is a member type of the Vec<T> class, you have to use the *typename* keyword before the Vec<T>:: scope. For example, if you want to define an iterator named *itr*, you can do it like this: ```console typename Vec::iterator itr ``` -without this typename keyword, if you define the iterator *itr* like this: +without this *typename* keyword, if you define the iterator *itr* like this: ```console Vec::iterator itr @@ -185,7 +185,7 @@ you will get a compiler error saying: error: need ‘typename’ before ‘Vec::iterator’ because ‘Vec’ is a dependent scope ``` -And the reason that this keyword typename is needed, is because without it, the compiler would think that Vec<T>::iterator is a member variable of the Vec<T> class, but this *typename* explicitly tells the compiler that Vec<T>::iterator is a type, rather than a member variable. +And the reason that this keyword *typename* is needed, is because without it, the compiler would think that Vec<T>::iterator is a member variable of the Vec<T> class, but this *typename* explicitly tells the compiler that Vec<T>::iterator is a type, rather than a member variable. **To complete this checkpoint**, show a TA your debugged solution for remove_matching_elements and be prepared to discuss the order notation of the function.