Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo
The C++ Standard Library: A Tutorial and Reference, Second Edition

Book Description

The Best-Selling C++ Resource

Now Updated for C++11

The C++ standard library provides a set of common classes and interfaces that greatly extend the core C++ language. The library, however, is not self-explanatory. To make full use of its components–and to benefit from their power–you need a resource that does far more than list the classes and their functions.

The C++ Standard Library: A Tutorial and Reference, Second Edition, describes this library as now incorporated into the new ANSI/ISO C++ language standard (C++11). The book provides comprehensive documentation of each library component, including an introduction to its purpose and design; clearly written explanations of complex concepts; the practical programming details needed for effective use; traps and pitfalls; the exact signature and definition of the most important classes and functions; and numerous examples of working code. The book focuses in particular on the Standard Template Library (STL), examining containers, iterators, function objects, and STL algorithms.

The book covers all the new C++11 library components, including

  • Concurrency

  • Fractional arithmetic

  • Clocks and timers

  • Tuples

  • New STL containers

  • New STL algorithms

  • New smart pointers

  • New locale facets

  • Random numbers and distributions

  • Type traits and utilities

  • Regular expressions

  • The book also examines the new C++ programming style and its effect on the standard library, including lambdas, range-based for  loops, move semantics, and variadic templates.

    An accompanying Web site, including source code, can be found at www.cppstdlib.com.

    Table of Contents

    1. Title Page
    2. Copyright Page
    3. Dedication Page
    4. Contents
    5. Preface to the Second Edition
    6. Acknowledgments for the Second Edition
    7. Preface to the First Edition
    8. Acknowledgments for the First Edition
    9. Chapter 1. About This Book
      1. 1.1. Why This Book
      2. 1.2. Before Reading This Book
      3. 1.3. Style and Structure of the Book
      4. 1.4. How to Read This Book
      5. 1.5. State of the Art
      6. 1.6. Example Code and Additional Information
      7. 1.7. Feedback
    10. Chapter 2. Introduction to C++ and the Standard Library
      1. 2.1. History of the C++ Standards
        1. 2.1.1. Common Questions about the C++11 Standard
        2. 2.1.2. Compatibility between C++98 and C++11
      2. 2.2. Complexity and Big-O Notation
    11. Chapter 3. New Language Features
      1. 3.1. New C++11 Language Features
        1. 3.1.1. Important Minor Syntax Cleanups
        2. 3.1.2. Automatic Type Deduction with auto
        3. 3.1.3. Uniform Initialization and Initializer Lists
        4. 3.1.4. Range-Based for Loops
        5. 3.1.5. Move Semantics and Rvalue References
        6. 3.1.6. New String Literals
        7. 3.1.7. Keyword noexcept
        8. 3.1.8. Keyword constexpr
        9. 3.1.9. New Template Features
        10. 3.1.10. Lambdas
        11. 3.1.11. Keyword decltype
        12. 3.1.12. New Function Declaration Syntax
        13. 3.1.13. Scoped Enumerations
        14. 3.1.14. New Fundamental Data Types
      2. 3.2. Old “New” Language Features
        1. 3.2.1. Explicit Initialization for Fundamental Types
        2. 3.2.2. Definition of main()
    12. Chapter 4. General Concepts
      1. 4.1. Namespace std
      2. 4.2. Header Files
      3. 4.3. Error and Exception Handling
        1. 4.3.1. Standard Exception Classes
        2. 4.3.2. Members of Exception Classes
        3. 4.3.3. Passing Exceptions with Class exception_ptr
        4. 4.3.4. Throwing Standard Exceptions
        5. 4.3.5. Deriving from Standard Exception Classes
      4. 4.4. Callable Objects
      5. 4.5. Concurrency and Multithreading
      6. 4.6. Allocators
    13. Chapter 5. Utilities
      1. 5.1. Pairs and Tuples
        1. 5.1.1. Pairs
        2. 5.1.2. Tuples
        3. 5.1.3. I/O for Tuples
        4. 5.1.4. Conversions between tuples and pairs
      2. 5.2. Smart Pointers
        1. 5.2.1. Class shared_ptr
        2. 5.2.2. Class weak_ptr
        3. 5.2.3. Misusing Shared Pointers
        4. 5.2.4. Shared and Weak Pointers in Detail
        5. 5.2.5. Class unique_ptr
        6. 5.2.6. Class unique_ptr in Detail
        7. 5.2.7. Class auto_ptr
        8. 5.2.8. Final Words on Smart Pointers
      3. 5.3. Numeric Limits
      4. 5.4. Type Traits and Type Utilities
        1. 5.4.1. Purpose of Type Traits
        2. 5.4.2. Type Traits in Detail
        3. 5.4.3. Reference Wrappers
        4. 5.4.4. Function Type Wrappers
      5. 5.5. Auxiliary Functions
        1. 5.5.1. Processing the Minimum and Maximum
        2. 5.5.2. Swapping Two Values
        3. 5.5.3. Supplementary Comparison Operators
      6. 5.6. Compile-Time Fractional Arithmetic with Class ratio<>
      7. 5.7. Clocks and Timers
        1. 5.7.1. Overview of the Chrono Library
        2. 5.7.2. Durations
        3. 5.7.3. Clocks and Timepoints
        4. 5.7.4. Date and Time Functions by C and POSIX
        5. 5.7.5. Blocking with Timers
      8. 5.8. Header Files <cstddef>, <cstdlib>, and <cstring>
        1. 5.8.1. Definitions in <cstddef>
        2. 5.8.2. Definitions in <cstdlib>
        3. 5.8.3. Definitions in <cstring>
    14. Chapter 6. The Standard Template Library
      1. 6.1. STL Components
      2. 6.2. Containers
        1. 6.2.1. Sequence Containers
        2. 6.2.2. Associative Containers
        3. 6.2.3. Unordered Containers
        4. 6.2.4. Associative Arrays
        5. 6.2.5. Other Containers
        6. 6.2.6. Container Adapters
      3. 6.3. Iterators
        1. 6.3.1. Further Examples of Using Associative and Unordered Containers
        2. 6.3.2. Iterator Categories
      4. 6.4. Algorithms
        1. 6.4.1. Ranges
        2. 6.4.2. Handling Multiple Ranges
      5. 6.5. Iterator Adapters
        1. 6.5.1. Insert Iterators
        2. 6.5.2. Stream Iterators
        3. 6.5.3. Reverse Iterators
        4. 6.5.4. Move Iterators
      6. 6.6. User-Defined Generic Functions
      7. 6.7. Manipulating Algorithms
        1. 6.7.1. “Removing” Elements
        2. 6.7.2. Manipulating Associative and Unordered Containers
        3. 6.7.3. Algorithms versus Member Functions
      8. 6.8. Functions as Algorithm Arguments
        1. 6.8.1. Using Functions as Algorithm Arguments
        2. 6.8.2. Predicates
      9. 6.9. Using Lambdas
      10. 6.10. Function Objects
        1. 6.10.1. Definition of Function Objects
        2. 6.10.2. Predefined Function Objects
        3. 6.10.3. Binders
        4. 6.10.4. Function Objects and Binders versus Lambdas
      11. 6.11. Container Elements
        1. 6.11.1. Requirements for Container Elements
        2. 6.11.2. Value Semantics or Reference Semantics
      12. 6.12. Errors and Exceptions inside the STL
        1. 6.12.1. Error Handling
        2. 6.12.2. Exception Handling
      13. 6.13. Extending the STL
        1. 6.13.1. Integrating Additional Types
        2. 6.13.2. Deriving from STL Types
    15. Chapter 7. STL Containers
      1. 7.1. Common Container Abilities and Operations
        1. 7.1.1. Container Abilities
        2. 7.1.2. Container Operations
        3. 7.1.3. Container Types
      2. 7.2. Arrays
        1. 7.2.1. Abilities of Arrays
        2. 7.2.2. Array Operations
        3. 7.2.3. Using arrays as C-Style Arrays
        4. 7.2.4. Exception Handling
        5. 7.2.5. Tuple Interface
        6. 7.2.6. Examples of Using Arrays
      3. 7.3. Vectors
        1. 7.3.1. Abilities of Vectors
        2. 7.3.2. Vector Operations
        3. 7.3.3. Using Vectors as C-Style Arrays
        4. 7.3.4. Exception Handling
        5. 7.3.5. Examples of Using Vectors
        6. 7.3.6. Class vector<bool>
      4. 7.4. Deques
        1. 7.4.1. Abilities of Deques
        2. 7.4.2. Deque Operations
        3. 7.4.3. Exception Handling
        4. 7.4.4. Examples of Using Deques
      5. 7.5. Lists
        1. 7.5.1. Abilities of Lists
        2. 7.5.2. List Operations
        3. 7.5.3. Exception Handling
        4. 7.5.4. Examples of Using Lists
      6. 7.6. Forward Lists
        1. 7.6.1. Abilities of Forward Lists
        2. 7.6.2. Forward List Operations
        3. 7.6.3. Exception Handling
        4. 7.6.4. Examples of Using Forward Lists
      7. 7.7. Sets and Multisets
        1. 7.7.1. Abilities of Sets and Multisets
        2. 7.7.2. Set and Multiset Operations
        3. 7.7.3. Exception Handling
        4. 7.7.4. Examples of Using Sets and Multisets
        5. 7.7.5. Example of Specifying the Sorting Criterion at Runtime
      8. 7.8. Maps and Multimaps
        1. 7.8.1. Abilities of Maps and Multimaps
        2. 7.8.2. Map and Multimap Operations
        3. 7.8.3. Using Maps as Associative Arrays
        4. 7.8.4. Exception Handling
        5. 7.8.5. Examples of Using Maps and Multimaps
        6. 7.8.6. Example with Maps, Strings, and Sorting Criterion at Runtime
      9. 7.9. Unordered Containers
        1. 7.9.1. Abilities of Unordered Containers
        2. 7.9.2. Creating and Controlling Unordered Containers
        3. 7.9.3. Other Operations for Unordered Containers
        4. 7.9.4. The Bucket Interface
        5. 7.9.5. Using Unordered Maps as Associative Arrays
        6. 7.9.6. Exception Handling
        7. 7.9.7. Examples of Using Unordered Containers
      10. 7.10. Other STL Containers
        1. 7.10.1. Strings as STL Containers
        2. 7.10.2. Ordinary C-Style Arrays as STL Containers
      11. 7.11. Implementing Reference Semantics
      12. 7.12. When to Use Which Container
    16. Chapter 8. STL Container Members in Detail
      1. 8.1. Type Definitions
      2. 8.2. Create, Copy, and Destroy Operations
      3. 8.3. Nonmodifying Operations
        1. 8.3.1. Size Operations
        2. 8.3.2. Comparison Operations
        3. 8.3.3. Nonmodifying Operations for Associative and Unordered Containers
      4. 8.4. Assignments
      5. 8.5. Direct Element Access
      6. 8.6. Operations to Generate Iterators
      7. 8.7. Inserting and Removing Elements
        1. 8.7.1. Inserting Single Elements
        2. 8.7.2. Inserting Multiple Elements
        3. 8.7.3. Removing Elements
        4. 8.7.4. Resizing
      8. 8.8. Special Member Functions for Lists and Forward Lists
        1. 8.8.1. Special Member Functions for Lists (and Forward Lists)
        2. 8.8.2. Special Member Functions for Forward Lists Only
      9. 8.9. Container Policy Interfaces
        1. 8.9.1. Nonmodifying Policy Functions
        2. 8.9.2. Modifying Policy Functions
        3. 8.9.3. Bucket Interface for Unordered Containers
      10. 8.10. Allocator Support
        1. 8.10.1. Fundamental Allocator Members
        2. 8.10.2. Constructors with Optional Allocator Parameters
    17. Chapter 9. STL Iterators
      1. 9.1. Header Files for Iterators
      2. 9.2. Iterator Categories
        1. 9.2.1. Output Iterators
        2. 9.2.2. Input Iterators
        3. 9.2.3. Forward Iterators
        4. 9.2.4. Bidirectional Iterators
        5. 9.2.5. Random-Access Iterators
        6. 9.2.6. The Increment and Decrement Problem of Vector Iterators
      3. 9.3. Auxiliary Iterator Functions
        1. 9.3.1. advance()
        2. 9.3.2. next() and prev()
        3. 9.3.3. distance()
        4. 9.3.4. iter_swap()
      4. 9.4. Iterator Adapters
        1. 9.4.1. Reverse Iterators
        2. 9.4.2. Insert Iterators
        3. 9.4.3. Stream Iterators
        4. 9.4.4. Move Iterators
      5. 9.5. Iterator Traits
        1. 9.5.1. Writing Generic Functions for Iterators
      6. 9.6. Writing User-Defined Iterators
    18. Chapter 10. STL Function Objects and Using Lambdas
      1. 10.1. The Concept of Function Objects
        1. 10.1.1. Function Objects as Sorting Criteria
        2. 10.1.2. Function Objects with Internal State
        3. 10.1.3. The Return Value of for_each()
        4. 10.1.4. Predicates versus Function Objects
      2. 10.2. Predefined Function Objects and Binders
        1. 10.2.1. Predefined Function Objects
        2. 10.2.2. Function Adapters and Binders
        3. 10.2.3. User-Defined Function Objects for Function Adapters
        4. 10.2.4. Deprecated Function Adapters
      3. 10.3. Using Lambdas
        1. 10.3.1. Lambdas versus Binders
        2. 10.3.2. Lambdas versus Stateful Function Objects
        3. 10.3.3. Lambdas Calling Global and Member Functions
        4. 10.3.4. Lambdas as Hash Function, Sorting, or Equivalence Criterion
    19. Chapter 11. STL Algorithms
      1. 11.1. Algorithm Header Files
      2. 11.2. Algorithm Overview
        1. 11.2.1. A Brief Introduction
        2. 11.2.2. Classification of Algorithms
      3. 11.3. Auxiliary Functions
      4. 11.4. The for_each() Algorithm
      5. 11.5. Nonmodifying Algorithms
        1. 11.5.1. Counting Elements
        2. 11.5.2. Minimum and Maximum
        3. 11.5.3. Searching Elements
        4. 11.5.4. Comparing Ranges
        5. 11.5.5. Predicates for Ranges
      6. 11.6. Modifying Algorithms
        1. 11.6.1. Copying Elements
        2. 11.6.2. Moving Elements
        3. 11.6.3. Transforming and Combining Elements
        4. 11.6.4. Swapping Elements
        5. 11.6.5. Assigning New Values
        6. 11.6.6. Replacing Elements
      7. 11.7. Removing Algorithms
        1. 11.7.1. Removing Certain Values
        2. 11.7.2. Removing Duplicates
      8. 11.8. Mutating Algorithms
        1. 11.8.1. Reversing the Order of Elements
        2. 11.8.2. Rotating Elements
        3. 11.8.3. Permuting Elements
        4. 11.8.4. Shuffling Elements
        5. 11.8.5. Moving Elements to the Front
        6. 11.8.6. Partition into Two Subranges
      9. 11.9. Sorting Algorithms
        1. 11.9.1. Sorting All Elements
        2. 11.9.2. Partial Sorting
        3. 11.9.3. Sorting According to the nth Element
        4. 11.9.4. Heap Algorithms
      10. 11.10. Sorted-Range Algorithms
        1. 11.10.1. Searching Elements
        2. 11.10.2. Merging Elements
      11. 11.11. Numeric Algorithms
        1. 11.11.1. Processing Results
        2. 11.11.2. Converting Relative and Absolute Values
    20. Chapter 12. Special Containers
      1. 12.1. Stacks
        1. 12.1.1. The Core Interface
        2. 12.1.2. Example of Using Stacks
        3. 12.1.3. A User-Defined Stack Class
        4. 12.1.4. Class stack<> in Detail
      2. 12.2. Queues
        1. 12.2.1. The Core Interface
        2. 12.2.2. Example of Using Queues
        3. 12.2.3. A User-Defined Queue Class
        4. 12.2.4. Class queue<> in Detail
      3. 12.3. Priority Queues
        1. 12.3.1. The Core Interface
        2. 12.3.2. Example of Using Priority Queues
        3. 12.3.3. Class priority_queue<> in Detail
      4. 12.4. Container Adapters in Detail
        1. 12.4.1. Type Definitions
        2. 12.4.2. Constructors
        3. 12.4.3. Supplementary Constructors for Priority Queues
        4. 12.4.4. Operations
      5. 12.5. Bitsets
        1. 12.5.1. Examples of Using Bitsets
        2. 12.5.2. Class bitset in Detail
    21. Chapter 13. Strings
      1. 13.1. Purpose of the String Classes
        1. 13.1.1. A First Example: Extracting a Temporary Filename
        2. 13.1.2. A Second Example: Extracting Words and Printing Them Backward
      2. 13.2. Description of the String Classes
        1. 13.2.1. String Types
        2. 13.2.2. Operation Overview
        3. 13.2.3. Constructors and Destructor
        4. 13.2.4. Strings and C-Strings
        5. 13.2.5. Size and Capacity
        6. 13.2.6. Element Access
        7. 13.2.7. Comparisons
        8. 13.2.8. Modifiers
        9. 13.2.9. Substrings and String Concatenation
        10. 13.2.10. Input/Output Operators
        11. 13.2.11. Searching and Finding
        12. 13.2.12. The Value npos
        13. 13.2.13. Numeric Conversions
        14. 13.2.14. Iterator Support for Strings
        15. 13.2.15. Internationalization
        16. 13.2.16. Performance
        17. 13.2.17. Strings and Vectors
      3. 13.3. String Class in Detail
        1. 13.3.1. Type Definitions and Static Values
        2. 13.3.2. Create, Copy, and Destroy Operations
        3. 13.3.3. Operations for Size and Capacity
        4. 13.3.4. Comparisons
        5. 13.3.5. Character Access
        6. 13.3.6. Generating C-Strings and Character Arrays
        7. 13.3.7. Modifying Operations
        8. 13.3.8. Searching and Finding
        9. 13.3.9. Substrings and String Concatenation
        10. 13.3.10. Input/Output Functions
        11. 13.3.11. Numeric Conversions
        12. 13.3.12. Generating Iterators
        13. 13.3.13. Allocator Support
    22. Chapter 14. Regular Expressions
      1. 14.1. The Regex Match and Search Interface
      2. 14.2. Dealing with Subexpressions
      3. 14.3. Regex Iterators
      4. 14.4. Regex Token Iterators
      5. 14.5. Replacing Regular Expressions
      6. 14.6. Regex Flags
      7. 14.7. Regex Exceptions
      8. 14.8. The Regex ECMAScript Grammar
      9. 14.9. Other Grammars
      10. 14.10. Basic Regex Signatures in Detail
    23. Chapter 15. Input/Output Using Stream Classes
      1. 15.1. Common Background of I/O Streams
        1. 15.1.1. Stream Objects
        2. 15.1.2. Stream Classes
        3. 15.1.3. Global Stream Objects
        4. 15.1.4. Stream Operators
        5. 15.1.5. Manipulators
        6. 15.1.6. A Simple Example
      2. 15.2. Fundamental Stream Classes and Objects
        1. 15.2.1. Classes and Class Hierarchy
        2. 15.2.2. Global Stream Objects
        3. 15.2.3. Header Files
      3. 15.3. Standard Stream Operators << and >>
        1. 15.3.1. Output Operator <<
        2. 15.3.2. Input Operator >>
        3. 15.3.3. Input/Output of Special Types
      4. 15.4. State of Streams
        1. 15.4.1. Constants for the State of Streams
        2. 15.4.2. Member Functions Accessing the State of Streams
        3. 15.4.3. Stream State and Boolean Conditions
        4. 15.4.4. Stream State and Exceptions
      5. 15.5. Standard Input/Output Functions
        1. 15.5.1. Member Functions for Input
        2. 15.5.2. Member Functions for Output
        3. 15.5.3. Example Uses
        4. 15.5.4. sentry Objects
      6. 15.6. Manipulators
        1. 15.6.1. Overview of All Manipulators
        2. 15.6.2. How Manipulators Work
        3. 15.6.3. User-Defined Manipulators
      7. 15.7. Formatting
        1. 15.7.1. Format Flags
        2. 15.7.2. Input/Output Format of Boolean Values
        3. 15.7.3. Field Width, Fill Character, and Adjustment
        4. 15.7.4. Positive Sign and Uppercase Letters
        5. 15.7.5. Numeric Base
        6. 15.7.6. Floating-Point Notation
        7. 15.7.7. General Formatting Definitions
      8. 15.8. Internationalization
      9. 15.9. File Access
        1. 15.9.1. File Stream Classes
        2. 15.9.2. Rvalue and Move Semantics for File Streams
        3. 15.9.3. File Flags
        4. 15.9.4. Random Access
        5. 15.9.5. Using File Descriptors
      10. 15.10. Stream Classes for Strings
        1. 15.10.1. String Stream Classes
        2. 15.10.2. Move Semantics for String Streams
        3. 15.10.3. char* Stream Classes
      11. 15.11. Input/Output Operators for User-Defined Types
        1. 15.11.1. Implementing Output Operators
        2. 15.11.2. Implementing Input Operators
        3. 15.11.3. Input/Output Using Auxiliary Functions
        4. 15.11.4. User-Defined Format Flags
        5. 15.11.5. Conventions for User-Defined Input/Output Operators
      12. 15.12. Connecting Input and Output Streams
        1. 15.12.1. Loose Coupling Using tie()
        2. 15.12.2. Tight Coupling Using Stream Buffers
        3. 15.12.3. Redirecting Standard Streams
        4. 15.12.4. Streams for Reading and Writing
      13. 15.13. The Stream Buffer Classes
        1. 15.13.1. The Stream Buffer Interfaces
        2. 15.13.2. Stream Buffer Iterators
        3. 15.13.3. User-Defined Stream Buffers
      14. 15.14. Performance Issues
        1. 15.14.1. Synchronization with C’s Standard Streams
        2. 15.14.2. Buffering in Stream Buffers
        3. 15.14.3. Using Stream Buffers Directly
    24. Chapter 16. Internationalization
      1. 16.1. Character Encodings and Character Sets
        1. 16.1.1. Multibyte and Wide-Character Text
        2. 16.1.2. Different Character Sets
        3. 16.1.3. Dealing with Character Sets in C++
        4. 16.1.4. Character Traits
        5. 16.1.5. Internationalization of Special Characters
      2. 16.2. The Concept of Locales
        1. 16.2.1. Using Locales
        2. 16.2.2. Locale Facets
      3. 16.3. Locales in Detail
      4. 16.4. Facets in Detail
        1. 16.4.1. Numeric Formatting
        2. 16.4.2. Monetary Formatting
        3. 16.4.3. Time and Date Formatting
        4. 16.4.4. Character Classification and Conversion
        5. 16.4.5. String Collation
        6. 16.4.6. Internationalized Messages
    25. Chapter 17. Numerics
      1. 17.1. Random Numbers and Distributions
        1. 17.1.1. A First Example
        2. 17.1.2. Engines
        3. 17.1.3. Engines in Detail
        4. 17.1.4. Distributions
        5. 17.1.5. Distributions in Detail
      2. 17.2. Complex Numbers
        1. 17.2.1. Class complex<> in General
        2. 17.2.2. Examples Using Class complex<>
        3. 17.2.3. Operations for Complex Numbers
        4. 17.2.4. Class complex<> in Detail
      3. 17.3. Global Numeric Functions
      4. 17.4. Valarrays
    26. Chapter 18. Concurrency
      1. 18.1. The High-Level Interface: async() and Futures
        1. 18.1.1. A First Example Using async() and Futures
        2. 18.1.2. An Example of Waiting for Two Tasks
        3. 18.1.3. Shared Futures
      2. 18.2. The Low-Level Interface: Threads and Promises
        1. 18.2.1. Class std::thread
        2. 18.2.2. Promises
        3. 18.2.3. Class packaged_task<>
      3. 18.3. Starting a Thread in Detail
        1. 18.3.1. async() in Detail
        2. 18.3.2. Futures in Detail
        3. 18.3.3. Shared Futures in Detail
        4. 18.3.4. Class std::promise in Detail
        5. 18.3.5. Class std::packaged_task in Detail
        6. 18.3.6. Class std::thread in Detail
        7. 18.3.7. Namespace this_thread
      4. 18.4. Synchronizing Threads, or the Problem of Concurrency
        1. 18.4.1. Beware of Concurrency!
        2. 18.4.2. The Reason for the Problem of Concurrent Data Access
        3. 18.4.3. What Exactly Can Go Wrong (the Extent of the Problem)
        4. 18.4.4. The Features to Solve the Problems
      5. 18.5. Mutexes and Locks
        1. 18.5.1. Using Mutexes and Locks
        2. 18.5.2. Mutexes and Locks in Detail
        3. 18.5.3. Calling Once for Multiple Threads
      6. 18.6. Condition Variables
        1. 18.6.1. Purpose of Condition Variables
        2. 18.6.2. A First Complete Example for Condition Variables
        3. 18.6.3. Using Condition Variables to Implement a Queue for Multiple Threads
        4. 18.6.4. Condition Variables in Detail
      7. 18.7. Atomics
        1. 18.7.1. Example of Using Atomics
        2. 18.7.2. Atomics and Their High-Level Interface in Detail
        3. 18.7.3. The C-Style Interface of Atomics
        4. 18.7.4. The Low-Level Interface of Atomics
    27. Chapter 19. Allocators
      1. 19.1. Using Allocators as an Application Programmer
      2. 19.2. A User-Defined Allocator
      3. 19.3. Using Allocators as a Library Programmer
    28. Bibliography
      1. Newsgroups and Forums
      2. Books and Web Sites
    29. Index
    30. Supplementary Chapter
      1. S.1. Bitsets
        1. S.1.1. Examples of Using Bitsets
        2. S.1.2. Class bitset<> in Detail
      2. S.2. Valarrays
        1. Recent Changes with C++11
        2. S.2.1. Getting to Know Valarrays
        3. S.2.2. Valarray Subsets
        4. S.2.3 Class valarray in Detail
        5. S.2.4. Valarray Subset Classes in Detail
      3. S.3. Allocators and Memory Functions in Detail
        1. S.3.1. Scoped Allocators
        2. S.3.2. A User-Defined Allocator for C++98
        3. S.3.3. The Default Allocator
        4. S.3.4. Allocators in Detail
        5. S.3.5. Utilities for Uninitialized Memory in Detail