1.1 Writing a Simple C++ Program
1.1.1 Compiling and Executing Our Program
1.2 A First Look at Input/Output
1.4.3 Reading an Unknown Number of Inputs
1.5.2 A First Look at Member Functions
Chapter 2 Variables and Basic Types
2.2.2 Variable Declarations and Definitions
2.3.3 Understanding Compound Type Declarations
2.4.4 constexpr
and Constant Expressions
2.5.3 The decltype
Type Specifier
2.6 Defining Our Own Data Structures
2.6.1 Defining the Sales_data
Type
2.6.2 Using the Sales_data
Class
2.6.3 Writing Our Own Header Files
Chapter 3 Strings, Vectors, and Arrays
3.1 Namespace using
Declarations
3.2.1 Defining and Initializing string
s
3.2.3 Dealing with the Characters in a string
3.3.1 Defining and Initializing vector
s
3.3.2 Adding Elements to a vector
3.5.1 Defining and Initializing Built-in Arrays
3.5.2 Accessing the Elements of an Array
3.5.4 C-Style Character Strings
3.5.5 Interfacing to Older Code
4.1.2 Precedence and Associativity
4.3 Logical and Relational Operators
4.5 Increment and Decrement Operators
4.6 The Member Access Operators
4.11.1 The Arithmetic Conversions
4.11.2 Other Implicit Conversions
4.12 Operator Precedence Table
5.4.2 Traditional for
Statement
5.6 try
Blocks and Exception Handling
6.2.1 Passing Arguments by Value
6.2.2 Passing Arguments by Reference
6.2.3 const
Parameters and Arguments
6.2.5 main
: Handling Command-Line Options
6.2.6 Functions with Varying Parameters
6.3 Return Types and the return
Statement
6.3.1 Functions with No Return Value
6.3.2 Functions That Return a Value
6.3.3 Returning a Pointer to an Array
6.5 Features for Specialized Uses
6.5.2 Inline and constexpr
Functions
6.6.1 Argument Type Conversions
7.1 Defining Abstract Data Types
7.1.1 Designing the Sales_data
Class
7.1.2 Defining the Revised Sales_data
Class
7.1.3 Defining Nonmember Class-Related Functions
7.1.5 Copy, Assignment, and Destruction
7.2 Access Control and Encapsulation
7.3.2 Functions That Return *this
7.4.1 Name Lookup and Class Scope
7.5.1 Constructor Initializer List
7.5.3 The Role of the Default Constructor
7.5.4 Implicit Class-Type Conversions
8.1.1 No Copy or Assign for IO Objects
8.1.3 Managing the Output Buffer
8.2.1 Using File Stream Objects
Chapter 9 Sequential Containers
9.1 Overview of the Sequential Containers
9.2 Container Library Overview
9.2.4 Defining and Initializing a Container
9.2.6 Container Size Operations
9.3 Sequential Container Operations
9.3.1 Adding Elements to a Sequential Container
9.3.4 Specialized forward_list
Operations
9.3.6 Container Operations May Invalidate Iterators
9.5 Additional string
Operations
9.5.1 Other Ways to Construct string
s
9.5.2 Other Ways to Change a string
9.5.3 string
Search Operations
10.2 A First Look at the Algorithms
10.2.2 Algorithms That Write Container Elements
10.2.3 Algorithms That Reorder Container Elements
10.3.1 Passing a Function to an Algorithm
10.3.3 Lambda Captures and Returns
10.5 Structure of Generic Algorithms
10.5.1 The Five Iterator Categories
10.5.2 Algorithm Parameter Patterns
10.5.3 Algorithm Naming Conventions
10.6 Container-Specific Algorithms
Chapter 11 Associative Containers
11.1 Using an Associative Container
11.2 Overview of the Associative Containers
11.2.1 Defining an Associative Container
11.2.2 Requirements on Key Type
11.3 Operations on Associative Containers
11.3.1 Associative Container Iterators
11.3.6 A Word Transformation Map
12.1 Dynamic Memory and Smart Pointers
12.1.2 Managing Memory Directly
12.1.3 Using shared_ptr
s with new
12.1.4 Smart Pointers and Exceptions
12.3 Using the Library: A Text-Query Program
12.3.1 Design of the Query Program
12.3.2 Defining the Query Program Classes
Part III Tools for Class Authors
13.1 Copy, Assign, and Destroy
13.1.2 The Copy-Assignment Operator
13.2 Copy Control and Resource Management
13.2.1 Classes That Act Like Values
13.2.2 Defining Classes That Act Like Pointers
13.5 Classes That Manage Dynamic Memory
13.6.2 Move Constructor and Move Assignment
13.6.3 Rvalue References and Member Functions
Chapter 14 Overloaded Operations and Conversions
14.2 Input and Output Operators
14.2.1 Overloading the Output Operator <<
14.2.2 Overloading the Input Operator >>
14.3 Arithmetic and Relational Operators
14.6 Increment and Decrement Operators
14.8.1 Lambdas Are Function Objects
14.8.2 Library-Defined Function Objects
14.8.3 Callable Objects and function
14.9 Overloading, Conversions, and Operators
14.9.2 Avoiding Ambiguous Conversions
14.9.3 Function Matching and Overloaded Operators
Chapter 15 Object-Oriented Programming
15.2 Defining Base and Derived Classes
15.2.2 Defining a Derived Class
15.2.3 Conversions and Inheritance
15.5 Access Control and Inheritance
15.6 Class Scope under Inheritance
15.7 Constructors and Copy Control
15.7.2 Synthesized Copy Control and Inheritance
15.7.3 Derived-Class Copy-Control Members
15.8 Containers and Inheritance
15.9.1 An Object-Oriented Solution
15.9.2 The Query_base
and Query
Classes
Chapter 16 Templates and Generic Programming
16.1.5 Controlling Instantiations
16.1.6 Efficiency and Flexibility
16.2 Template Argument Deduction
16.2.1 Conversions and Template Type Parameters
16.2.2 Function-Template Explicit Arguments
16.2.3 Trailing Return Types and Type Transformation
16.2.4 Function Pointers and Argument Deduction
16.2.5 Template Argument Deduction and References
16.2.6 Understanding std::move
16.3 Overloading and Templates
16.4.1 Writing a Variadic Function Template
16.4.3 Forwarding Parameter Packs
Chapter 17 Specialized Library Facilities
17.1.1 Defining and Initializing tuple
s
17.1.2 Using a tuple
to Return Multiple Values
17.2.1 Defining and Initializing bitset
s
17.3.1 Using the Regular Expression Library
17.3.2 The Match and Regex Iterator Types
17.4.1 Random-Number Engines and Distribution
17.4.2 Other Kinds of Distributions
17.5.1 Formatted Input and Output
17.5.2 Unformatted Input/Output Operations
17.5.3 Random Access to a Stream
Chapter 18 Tools for Large Programs
18.1.3 Function try
Blocks and Constructors
18.1.4 The noexcept
Exception Specification
18.1.5 Exception Class Hierarchies
18.2.2 Using Namespace Members
18.2.3 Classes, Namespaces, and Scope
18.2.4 Overloading and Namespaces
18.3 Multiple and Virtual Inheritance
18.3.2 Conversions and Multiple Base Classes
18.3.3 Class Scope under Multiple Inheritance
18.3.5 Constructors and Virtual Inheritance
Chapter 19 Specialized Tools and Techniques
19.1 Controlling Memory Allocation
19.1.1 Overloading new
and delete
19.1.2 Placement new
Expressions
19.2 Run-Time Type Identification
19.2.1 The dynamic_cast
Operator
19.4.1 Pointers to Data Members
19.4.2 Pointers to Member Functions
19.4.3 Using Member Functions as Callable Objects
19.6 union
: A Space-Saving Class
19.8 Inherently Nonportable Features
19.8.3 Linkage Directives: extern "C"
A.2 A Brief Tour of the Algorithms
A.2.1 Algorithms to Find an Object
A.2.2 Other Read-Only Algorithms
A.2.3 Binary Search Algorithms
A.2.4 Algorithms That Write Container Elements
A.2.5 Partitioning and Sorting Algorithms
A.2.6 General Reordering Operations
A.2.8 Set Algorithms for Sorted Sequences
A.2.9 Minimum and Maximum Values