TEXTBOOK AND LECTURE-SLIDE ERRATA ================================= This document contains errata for the following textbook and lecture slides: M. D. Adams, Exercises for Programming in C++ (Version 2021-04-01) University of Victoria, Victoria, BC, Canada, Apr. 2021. M. D. Adams, Lecture Slides for Programming in C++ (Version 2021-04-01) University of Victoria, Victoria, BC, Canada, Apr. 2021. Below is a list of errors that have been found to date. ################################################################################ Date: unknown Name: unknown textbook p. 24 Exercise 4.7 "initialized to zero" should be "default constructed" p. 25 Exercise 4.7 the sample test code should print the moved-to object, not the moved-from object ################################################################################ Date: 2021-05-10 Name: Jamie Kirkwin lecture slides p. 1995 slide titled "Perfect and Complete Trees" The definition of a perfect binary tree needs tweaking. The definition should read something like "A binary tree is said to be perfect if each internal node has exactly two children and all leaves have the same depth". ################################################################################ Date: 2021-06-06 Name: Jamie Kirkwin lecture slides On slide number 2138 the second bullet reads "flippable edge said to be optimal if:" should instead read "edge said to be optimal if:" That is, the word "flippable" should be removed. ################################################################################ Date: 2022-07-04 Name: Vicky Nguyen lecture slides slides 1335, Vector Example: vec.hpp (5) In the push_back function, if the capacity is 0, the code will not work correctly. In this case, the grow member will be called with a size of 0 instead of some nonzero size like 1. ################################################################################ Date: 2023-05-10 Name: Jack Klobchar slide 1905 The second to last bullet says "Design your code so that is modular and can be written and tested in pieces" should instead be "Design your code so that it is modular and can be written and tested in pieces" That is, add the word "it". ################################################################################ Date: 2023-05-17 Name: Ryan O’Hara slide 1927 The last sequence is \Theta(\varphi^n) not \Theta(2^n), where \Theta = the golden ratio. ################################################################################ Date: 2023-05-17 Name: Ryan O’Hara slide 1932 The time complexity is \Theta(\varphi^n) not \Theta(2^n), where \Theta = the golden ratio. ################################################################################ Date: 2023-05-18 Name: Jack Klobchar slide 1901 "Code Duplication" The first bullet has some typos. It should be changed from .... If similar code is needed is more than place, put the code in a function... to ... If similar code is needed in more than one place, put the code in a function... ################################################################################ Date: 2023-05-22 Name: Jack Klobchar slide 318 "Example: Constexpr and Accessing External State" The source code comment on line 2-3 should have "would have state the persists" changed to "would have state that persists" (i.e., change "the" to "that") ################################################################################ Date: 2023-06-21 Name: Ryland Nezil textbook, p. 43, Exercise 6.8(a): It would be better to change the declaration void useBuffers(std::size_t, char* p1, char* p2) noexcept; to either name all function parameters or name none of them for consistency. ################################################################################ Date: 2023-07-12 Name: Michael Adams slide 653, Example: Header Model for Compilation The bottom left source file should be labelled as main.cpp not main.hpp. ################################################################################ Date: Name: ################################################################################