©Copyright 1999 Rogue Wave Software
Table of Contents
Chapter 1: Introduction
What is the Standard C++ Library?
Does the Standard C++ Library Differ From Other Libraries?
What are the Effects of Non-Object-Oriented Design?
How Should I Use the Standard C++ Library?
Reading This Manual
Conventions
Using the Standard Library
Running the Tutorial Programs
Chapter 2: Iterators
Introduction to Iterators
Varieties of Iterators
Input Iterators
Output Iterators
Forward Iterators
Bidirectional Iterators
Random Access Iterators
Reverse Iterators
Stream Iterators
Input Stream Iterators
Output Stream Iterators
Insert Iterators
Iterator Operations
Chapter 3: Functions and Predicates
Functions
Predicates
Function Objects
Negators and Binders
Chapter 4: Container Classes
Overview
Selecting a Container
Memory Management Issues
Container Types Not Found in the Standard Library
Chapter 5: vector and vector <bool>
The vector Data Abstraction
Include Files
Vector Operations
Declaration and Initialization of Vectors
Type Definitions
Subscripting a Vector
Extent and Size-Changing Operations
Inserting and Removing Elements
Iteration
Test for Inclusion
Sorting and Sorted Vector Operations
Useful Generic Algorithms
Boolean Vectors
Example Program - Sieve of Eratosthenes
Chapter 6: list
The list Data Abstraction
Include files
List Operations
Declaration and Initialization of Lists
Type Definitions
Placing Elements into a List
Removing Elements
Extent and Size-Changing Operations
Access and Iteration
Test for Inclusion
Sorting and Sorted List Operations
Searching Operations
In Place Transformations
Other Operations
Example Program - An Inventory System
Chapter 7: deque
The Deque Data Abstraction
Include Files
Deque Operations
Example Program - Radix Sort
Chapter 8: set, multiset, and bitset
The set Data Abstraction
Include Files
set and multiset Operations
Declaration and Initialization of Set
Type Definitions
Insertion
Removal of Elements from a Set
Searching and Counting
Iterators
Set Operations
Other Generic Algorithms
Example Program: - A Spelling Checker
The bitset Abstraction
Include Files
Declaration and Initialization of bitset
Accessing and Testing Elements
Set operations
Conversions
Chapter 9: map and multimap
The map Data Abstraction
Include files
Map and Multimap Operations
Declaration and Initialization of map
Type Definitions
Insertion and Access
Removal of Values
Iterators
Searching and Counting
Element Comparisons
Other Map Operations
Example Programs
A Telephone Database
Graphs
A Concordance
Chapter 10: stack and queue
Overview
The Stack Data Abstraction
Include Files
Declaration and Initialization of stack
Example Program - A RPN Calculator
The Queue Data Abstraction
Include Files
Declaration and Initialization of queue
Example Program - Bank Teller Simulation
Chapter 11: priority_queue
The priority queue Data Abstraction
Include Files
The Priority Queue Operations
Declaration and Initialization of priority queue
Application - Event-Driven Simulation
An Ice Cream Store Simulation
Chapter 12: String
The string Abstraction
Include Files
String Operations
Declaration and Initialization of string
Resetting Size and Capacity
Assignment, Append and Swap
Character Access
Iterators
Insertion, Removal and Replacement
Copy and Substring
String Comparisons
Searching Operations
An Example Function - Split a Line into Words
Chapter 13: Generic Algorithms
Overview
Include Files
Initialization Algorithms
Fill a Sequence with An Initial Value
Copy One Sequence Into Another Sequence
Initialize a Sequence with Generated Values
Swap Values from Two Parallel Ranges
Searching Operations
Find an Element Satisfying a Condition
Find Consecutive Duplicate Elements
Find a Subsequence within a Sequence
Locate Maximum or Minimum Element
Locate the First Mismatched Elements in Parallel Sequences
In-Place Transformations
Reverse Elements in a Sequence
Replace Certain Elements With Fixed Value
Rotate Elements Around a Midpoint
Partition a Sequence into Two Groups
Generate Permutations in Sequence
Merge Two Adjacent Sequences into One
Randomly Rearrange Elements in a Sequence
Removal Algorithms
Remove Unwanted Elements
Remove Runs of Similar Values
Scalar-Producing Algorithms
Count the Number of Elements that Satisfy a Condition
Reduce Sequence to a Single Value
Generalized Inner Product
Test Two Sequences for Pairwise Equality
Lexical Comparison
Sequence-Generating Algorithms
Transform One or Two Sequences
Partial Sums
Adjacent Differences
Miscellaneous Algorithms
Apply a Function to All Elements in a Collection
Chapter 14: Ordered Collection Algorithms
Overview
Include Files
Sorting Algorithms
Partial Sort
nth Element
Binary Search
Merge Ordered Sequences
Set Operations
Heap Operations
Chapter 15: Using Allocators
An Overview of the Standard Library Allocators
Using Allocators with Existing Standard Library Containers
Building Your Own Allocators
Using the Standard Allocator Interface
Using Rogue Wave's Alternative Interface
How to Support Both Interfaces
Chapter 16: Building Containers & Generic Algorithms
Extending the Library
Building on the Standard Containers
Inheritance
Generic Inheritance
Generic Composition
Creating Your Own Containers
Meeting the Container Requirements
Meeting the Allocator Interface Requirements
Iterator Requirements
Tips and Techniques for Building Algorithms
The iterator_category Primitive
The distance and advance Primitives
Chapter 17: The Traits Parameter
Using the Traits Technique
Chapter 18: Exception Handling
Overview
Include Files
The Standard Exception Hierarchy
Using Exceptions
Example Program
Chapter 19: auto_ptr
Overview
Include File
Declaration and Initialization of Auto Pointers
Example Program
Chapter 20: Complex
Overview
Include Files
Creating and Using Complex Numbers
Declaring Complex Numbers
Accessing Complex Number Values
Arithmetic Operations
Comparing Complex Values
Stream Input and Output
Norm and Absolute Value
Trigonometric Functions
Transcendental Functions
Example Program - Roots of a Polynomial
Chapter 21: Numeric Limits
Overview
Fundamental Data Types
Numeric Limit Members
Members Common to All Types
Members Specific to Floating Point Values
Chapter 22: Glossary