A Tour of C++, 3rd Edition

Book description

In A Tour of C++, Third Edition, Bjarne Stroustrup provides an overview of ISO C++, C++20, that aims to give experienced programmers a clear understanding of what constitutes modern C++. Featuring carefully crafted examples and practical help in getting started, this revised and updated edition concisely covers most major language features and the major standard-library components needed for effective use.

Stroustrup presents C++ features in the context of the programming styles they support, such as object-oriented and generic programming. His tour is remarkably comprehensive. Coverage begins with the basics, then ranges widely through more advanced topics, emphasizing newer language features. This edition covers many features that are new in C++20 as implemented by major C++ suppliers, including modules, concepts, coroutines, and ranges. It even introduces some library components in current use that are not scheduled for inclusion in the standard until C++23.

This authoritative guide does not aim to teach you how to program (for that, see Stroustrup's Programming: Principles and Practice Using C++, Second Edition), nor will it be the only resource you'll need for C++ mastery (for that, see Stroustrup's The C++ Programming Language, Fourth Edition, and recommended online sources). If, however, you are a C or C++ programmer wanting greater familiarity with the current C++ language, or a programmer versed in another language wishing to gain an accurate picture of the nature and benefits of modern C++, you won't find a shorter or simpler introduction.

..

Table of contents

  1. Cover Page
  2. About This eBook
  3. Halftitle Page
  4. Title Page
  5. Copyright Page
  6. Contents
  7. Preface
    1. Acknowledgments
  8. 1 The Basics
    1. 1.1 Introduction
    2. 1.2 Programs
    3. 1.3 Functions
    4. 1.4 Types, Variables, and Arithmetic
    5. 1.5 Scope and Lifetime
    6. 1.6 Constants
    7. 1.7 Pointers, Arrays, and References
    8. 1.8 Tests
    9. 1.9 Mapping to Hardware
    10. 1.10 Advice
  9. 2 User-Defined Types
    1. 2.1 Introduction
    2. 2.2 Structures
    3. 2.3 Classes
    4. 2.4 Enumerations
    5. 2.5 Unions
    6. 2.6 Advice
  10. 3 Modularity
    1. 3.1 Introduction
    2. 3.2 Separate Compilation
    3. 3.3 Namespaces
    4. 3.4 Function Arguments and Return Values
    5. 3.5 Advice
  11. 4 Error Handling
    1. 4.1 Introduction
    2. 4.2 Exceptions
    3. 4.3 Invariants
    4. 4.4 Error-Handling Alternatives
    5. 4.5 Assertions
    6. 4.6 Advice
  12. 5 Classes
    1. 5.1 Introduction
    2. 5.2 Concrete Types
    3. 5.3 Abstract Types
    4. 5.4 Virtual Functions
    5. 5.5 Class Hierarchies
    6. 5.6 Advice
  13. 6 Essential Operations
    1. 6.1 Introduction
    2. 6.2 Copy and Move
    3. 6.3 Resource Management
    4. 6.4 Operator Overloading
    5. 6.5 Conventional Operations
    6. 6.6 User-Defined Literals
    7. 6.7 Advice
  14. 7 Templates
    1. 7.1 Introduction
    2. 7.2 Parameterized Types
    3. 7.3 Parameterized Operations
    4. 7.4 Template Mechanisms
    5. 7.5 Advice
  15. 8 Concepts and Generic Programming
    1. 8.1 Introduction
    2. 8.2 Concepts
    3. 8.3 Generic Programming
    4. 8.4 Variadic Templates
    5. 8.5 Template Compilation Model
    6. 8.6 Advice
  16. 9 Library Overview
    1. 9.1 Introduction
    2. 9.2 Standard-Library Components
    3. 9.3 Standard-Library Organization
    4. 9.4 Advice
  17. 10 Strings and Regular Expressions
    1. 10.1 Introduction
    2. 10.2 Strings
    3. 10.3 String Views
    4. 10.4 Regular Expressions
    5. 10.5 Advice
  18. 11 Input and Output
    1. 11.1 Introduction
    2. 11.2 Output
    3. 11.3 Input
    4. 11.4 I/O State
    5. 11.5 I/O of User-Defined Types
    6. 11.6 Output Formatting
    7. 11.7 Streams
    8. 11.8 C-style I/O
    9. 11.9 File System
    10. 11.10 Advice
  19. 12 Containers
    1. 12.1 Introduction
    2. 12.2 vector
    3. 12.3 list
    4. 12.4 forward_list
    5. 12.5 map
    6. 12.6 unordered_map
    7. 12.7 Allocators
    8. 12.8 Container Overview
    9. 12.9 Advice
  20. 13 Algorithms
    1. 13.1 Introduction
    2. 13.2 Use of Iterators
    3. 13.3 Iterator Types
    4. 13.4 Use of Predicates
    5. 13.5 Algorithm Overview
    6. 13.6 Parallel Algorithms
    7. 13.7 Advice
  21. 14 Ranges
    1. 14.1 Introduction
    2. 14.2 Views
    3. 14.3 Generators
    4. 14.4 Pipelines
    5. 14.5 Concepts Overview
    6. 14.6 Advice
  22. 15 Pointers and Containers
    1. 15.1 Introduction
    2. 15.2 Pointers
    3. 15.3 Containers
    4. 15.4 Alternatives
    5. 15.5 Advice
  23. 16 Utilities
    1. 16.1 Introduction
    2. 16.2 Time
    3. 16.3 Function Adaption
    4. 16.4 Type Functions
    5. 16.5 source_location
    6. 16.6 move() and forward()
    7. 16.7 Bit Manipulation
    8. 16.8 Exiting a Program
    9. 16.9 Advice
  24. 17 Numerics
    1. 17.1 Introduction
    2. 17.2 Mathematical Functions
    3. 17.3 Numerical Algorithms
    4. 17.4 Complex Numbers
    5. 17.5 Random Numbers
    6. 17.6 Vector Arithmetic
    7. 17.7 Numeric Limits
    8. 17.8 Type Aliases
    9. 17.9 Mathematical Constants
    10. 17.10 Advice
  25. 18 Concurrency
    1. 18.1 Introduction
    2. 18.2 Tasks and threads
    3. 18.3 Sharing Data
    4. 18.4 Waiting for Events
    5. 18.5 Communicating Tasks
    6. 18.6 Coroutines
    7. 18.7 Advice
  26. 19 History and Compatibility
    1. 19.1 History
    2. 19.2 C++ Feature Evolution
    3. 19.3 C/C++ Compatibility
    4. 19.4 Bibliography
    5. 19.5 Advice
  27. Module std
    1. A.1 Introduction
    2. A.2 Use What Your Implementation Offers
    3. A.3 Use Headers
    4. A.4 Make Your Own module std
    5. A.5 Advice
  28. Index
  29. Code Snippets

Product information

  • Title: A Tour of C++, 3rd Edition
  • Author(s): Bjarne Stroustrup
  • Release date: September 2022
  • Publisher(s): Addison-Wesley Professional
  • ISBN: 9780136823575