April 2024
Beginner
656 pages
23h 19m
English
When someone says I want a programming language in which I need only say what I wish done, give him a lollipop.
– Alan Perlis
This chapter describes how vectors are copied and accessed through subscripting. To do that, we discuss copying in general and present the essential operations that must be considered for every type: construction, default construction, copy, move, and destruction. Like many types, vector offers comparisons, so we show how to provide operations such as == and <. Finally, we grapple with the problems of changing the size of a vector: why and how?