Skip to Content
Programming: Principles and Practice Using C++, 3rd Edition
book

Programming: Principles and Practice Using C++, 3rd Edition

by Bjarne Stroustrup
April 2024
Beginner
656 pages
23h 19m
English
Addison-Wesley Professional
Content preview from Programming: Principles and Practice Using C++, 3rd Edition

17

Essential Operations

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?

§17.1 Introduction

§17.2 Access to elements

§17.3 List initialization

§17.4 Copying and moving

Copy constructors; Copy assignments; Copy terminology;

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming: Principles and Practice Using C++, 2nd Edition

Programming: Principles and Practice Using C++, 2nd Edition

Bjarne Stroustrup

Publisher Resources

ISBN: 9780138308667