1.1 Writing a Simple C++ Program
1.1.1 Compiling and Executing Our Program
1.2 A First Look at Input/Output
1.2.1 Standard Input and Output Objects
1.2.2 A Program that Uses the IO Library
1.4.4 Reading an Unknown Number of Inputs
1.5.2 A First Look at Member Functions
Chapter 2. Variables and Basic Types
2.3.4 Variable Initialization Rules
2.3.5 Declarations and Definitions
2.3.7 Define Variables Where They Are Used
2.9 Writing Our Own Header Files
2.9.1 Designing Our Own Headers
2.9.2 A Brief Introduction to the Preprocessor
3.1 Namespace using Declarations
3.2.1 Defining and Initializing strings
3.2.2 Reading and Writing strings
3.2.4 Dealing with the Characters of a string
3.3.1 Defining and Initializing vectors
3.5.1 Defining and Initializing bitsets
Chapter 4. Arrays and Pointers
4.1.1 Defining and Initializing Arrays
4.2.2 Defining and Initializing Pointers
4.2.4 Using Pointers to Access Array Elements
4.2.5 Pointers and the const Qualifier
4.3.1 Dynamically Allocating Arrays
4.3.2 Interfacing to Older Code
4.4.1 Pointers and Multidimensioned Arrays
5.2 Relational and Logical Operators
5.3.1 Using bitset Objects or Integral Values
5.3.2 Using the Shift Operators for IO
5.4.1 Assignment Is Right Associative
5.4.2 Assignment Has Low Precedence
5.4.3 Compound Assignment Operators
5.5 Increment and Decrement Operators
5.10 Evaluating Compound Expressions
5.11 The new and delete Expressions
5.12.1 When Implicit Type Conversions Occur
5.12.2 The Arithmetic Conversions
5.12.3 Other Implicit Conversions
5.12.5 When Casts Might Be Useful
6.3 Compound Statements (Blocks)
6.5.1 The if Statement else Branch
6.6.2 Control Flow within a switch
6.6.4 switch Expression and Case Labels
6.6.5 Variable Definitions inside a switch
6.8.1 Omitting Parts of the for Header
6.8.2 Multiple Definitions in the for Header
6.13 try Blocks and Exception Handling
6.14 Using the Preprocessor for Debugging
7.2.3 vector and Other Container Parameters
7.2.5 Managing Arrays Passed to Functions
7.2.6 main: Handling Command-Line Options
7.2.7 Functions with Varying Parameters
7.3.1 Functions with No Return Value
7.3.2 Functions that Return a Value
7.7.1 Defining the Body of a Member Function
7.7.2 Defining a Member Function Outside the Class
7.7.3 Writing the Sales_item Constructor
7.7.4 Organizing Class Code Files
7.8.2 Function Matching and Argument Conversions
7.8.3 The Three Steps in Overload Resolution
7.8.4 Argument-Type Conversions
8.1 An Object-Oriented Library
8.3 Managing the Output Buffer
8.4.1 Using File Stream Objects
8.4.3 A Program to Open and Check Input Files
Part II. Containers and Algorithms
Chapter 9. Sequential Containers
9.1 Defining a Sequential Container
9.1.1 Initializing Container Elements
9.1.2 Constraints on Types that a Container Can Hold
9.2 Iterators and Iterator Ranges
9.2.2 Some Container Operations Invalidate Iterators
9.3 Sequence Container Operations
9.3.3 Adding Elements to a Sequential Container
9.3.5 Container Size Operations
9.4.1 capacity and reserve Members
9.5 Deciding Which Container to Use
9.6.1 Other Ways to Construct strings
9.6.2 Other Ways to Change a string
9.6.4 string Search Operations
9.7.2 Queue and Priority Queue
Chapter 10. Associative Containers
10.1 Preliminaries: the pair Type
10.3.3 Adding Elements to a map
10.3.6 Finding and Retrieving a map Element
10.3.7 Erasing Elements from a map
10.3.9 A Word Transformation Map
10.4.1 Defining and Using sets
10.4.2 Building a Word-Exclusion Set
10.5 The multimap and multiset Types
10.5.1 Adding and Removing Elements
10.5.2 Finding Elements in a multimap or multiset
10.6 Using Containers: Text-Query Program
10.6.1 Design of the Query Program
10.6.3 Using the TextQuery Class
10.6.4 Writing the Member Functions
Chapter 11. Generic Algorithms
11.2 A First Look at the Algorithms
11.2.2 Algorithms that Write Container Elements
11.2.3 Algorithms that Reorder Container Elements
11.3.5 The Five Iterator Categories
11.4 Structure of Generic Algorithms
11.4.1 Algorithm Parameter Patterns
11.4.2 Algorithm Naming Conventions
11.5 Container-Specific Algorithms
Part III. Classes and Data Abstraction
12.1 Class Definitions and Declarations
12.1.1 Class Definitions: A Recap
12.1.2 Data Abstraction and Encapsulation
12.1.3 More on Class Definitions
12.1.4 Class Declarations versus Definitions
12.2 The Implicit this Pointer
12.3.1 Name Lookup in Class Scope
12.4.1 The Constructor Initializer
12.4.2 Default Arguments and Constructors
12.4.3 The Default Constructor
12.4.4 Implicit Class-Type Conversions
12.4.5 Explicit Initialization of Class Members
12.6.1 static Member Functions
13.1.1 The Synthesized Copy Constructor
13.1.2 Defining Our Own Copy Constructor
13.4 A Message-Handling Example
13.5.1 Defining Smart Pointer Classes
13.5.2 Defining Valuelike Classes
Chapter 14. Overloaded Operations and Conversions
14.1 Defining an Overloaded Operator
14.1.1 Overloaded Operator Design
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.7 Increment and Decrement Operators
14.8 Call Operator and Function Objects
14.8.1 Using Function Objects with Library Algorithms
14.8.2 Library-Defined Function Objects
14.8.3 Function Adaptors for Function Objects
14.9 Conversions and Class Types
14.9.1 Why Conversions Are Useful
14.9.3 Argument Matching and Conversions
14.9.4 Overload Resolution and Class Arguments
14.9.5 Overloading, Conversions, and Operators
Part IV. Object-Oriented and Generic Programming
Chapter 15. Object-Oriented Programming
15.2 Defining Base and Derived Classes
15.2.4 virtual and Other Member Functions
15.2.5 Public, Private, and Protected Inheritance
15.2.6 Friendship and Inheritance
15.2.7 Inheritance and Static Members
15.3 Conversions and Inheritance
15.3.1 Derived-to-Base Conversions
15.3.2 Conversions from Base to Derived
15.4 Constructors and Copy Control
15.4.1 Base-Class Constructors and Copy Control
15.4.2 Derived-Class Constructors
15.4.3 Copy Control and Inheritance
15.4.5 Virtuals in Constructors and Destructors
15.5 Class Scope under Inheritance
15.5.1 Name Lookup Happens at Compile Time
15.5.2 Name Collisions and Inheritance
15.5.3 Scope and Member Functions
15.5.4 Virtual Functions and Scope
15.7 Containers and Inheritance
15.8 Handle Classes and Inheritance
15.8.2 Cloning an Unknown Type
15.9.1 An Object-Oriented Solution
Chapter 16. Templates and Generic Programming
16.1.1 Defining a Function Template
16.1.2 Defining a Class Template
16.1.4 Template Type Parameters
16.1.5 Nontype Template Parameters
16.1.6 Writing Generic Programs
16.2.1 Template Argument Deduction
16.2.2 Function-Template Explicit Arguments
16.3 Template Compilation Models
16.4.1 Class-Template Member Functions
16.4.2 Template Arguments for Nontype Parameters
16.4.3 Friend Declarations in Class Templates
16.4.4 Queue and QueueItem Friend Declarations
16.4.6 The Complete Queue Class
16.4.7 static Members of Class Templates
16.5.1 Defining the Handle Class
16.6.1 Specializing a Function Template
16.6.2 Specializing a Class Template
16.6.3 Specializing Members but Not the Class
16.6.4 Class-Template Partial Specializations
16.7 Overloading and Function Templates
Chapter 17. Tools for Large Programs
17.1.1 Throwing an Exception of Class Type
17.1.6 Function Try Blocks and Constructors
17.1.7 Exception Class Hierarchies
17.1.8 Automatic Resource Deallocation
17.1.10 Exception Specifications
17.1.11 Function Pointer Exception Specifications
17.2.4 Using Namespace Members
17.2.5 Classes, Namespaces, and Scope
17.2.6 Overloading and Namespaces
17.2.7 Namespaces and Templates
17.3 Multiple and Virtual Inheritance
17.3.2 Conversions and Multiple Base Classes
17.3.3 Copy Control for Multiply Derived Classes
17.3.4 Class Scope under Multiple Inheritance
17.3.6 Virtual Base Class Declaration
17.3.7 Special Initialization Semantics
Chapter 18. Specialized Tools and Techniques
18.1 Optimizing Memory Allocation
18.1.1 Memory Allocation in C++
18.1.3 operator new and operator delete Functions
18.1.4 Placement new Expressions
18.1.5 Explicit Destructor Invocation
18.1.6 Class Specific new and delete
18.1.7 A Memory-Allocator Base Class
18.2 Run-Time Type Identification
18.2.1 The dynamic_cast Operator
18.3.1 Declaring a Pointer to Member
18.3.2 Using a Pointer to Class Member
18.4.1 A Nested-Class Implementation
18.4.2 Name Lookup in Nested Class Scope
18.5 Union: A Space-Saving Class
18.7 Inherently Nonportable Features
18.7.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
A.3.2 Many Manipulators Change the Format State
A.3.3 Controlling Output Formats
A.3.4 Controlling Input Formatting
A.3.5 Unformatted Input/Output Operations
A.3.8 Random Access to a Stream