You are previewing A Tour of C++.
O'Reilly logo
A Tour of C++

Book Description

The C++11 standard allows programmers to express ideas more clearly, simply, and directly, and to write faster, more efficient code. Bjarne Stroustrup, the designer and original implementer of C++, thoroughly covers the details of this language and its use in his definitive reference, The C++ Programming Language, Fourth Edition.

In A Tour of C++, Stroustrup excerpts the overview chapters from that complete reference, expanding and enhancing them to give an experienced programmer–in just a few hours–a clear idea of what constitutes modern C++. In this concise, self-contained guide, Stroustrup covers most major language features and the major standard-library components–not, of course, in great depth, but to a level that gives programmers a meaningful overview of the language, some key examples, and practical help in getting started.

Stroustrup presents the 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, including many that are new in C++11, such as move semantics, uniform initialization, lambda expressions, improved containers, random numbers, and concurrency. The tour ends with a discussion of the design and evolution of C++ and the extensions added for C++11.

This guide does not aim to teach you how to program (see Stroustrup’s Programming: Principles and Practice Using C++ for that); nor will it be the only resource you’ll need for C++ mastery (see Stroustrup’s The C++ Programming Language, Fourth Edition, for that). 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 can’t find a shorter or simpler introduction than this tour provides.

Table of Contents

  1. About This eBook
  2. Title Page
  3. Copyright Page
  4. The C++ In-Depth Series
  5. Contents
  6. Preface
    1. Acknowledgments
  7. 1. The Basics
    1. 1.1. Introduction
    2. 1.2. Programs
    3. 1.3. Hello, World!
    4. 1.4. Functions
    5. 1.5. Types, Variables, and Arithmetic
    6. 1.6. Scope and Lifetime
    7. 1.7. Constants
    8. 1.8. Pointers, Arrays, and References
    9. 1.9. Tests
    10. 1.10. Advice
  8. 2. User-Defined Types
    1. 2.1. Introduction
    2. 2.2. Structures
    3. 2.3. Classes
    4. 2.4. Unions
    5. 2.5. Enumerations
    6. 2.6. Advice
  9. 3. Modularity
    1. 3.1. Introduction
    2. 3.2. Separate Compilation
    3. 3.3. Namespaces
    4. 3.4. Error Handling
    5. 3.5. Advice
  10. 4. Classes
    1. 4.1. Introduction
    2. 4.2. Concrete Types
    3. 4.3. Abstract Types
    4. 4.4. Virtual Functions
    5. 4.5. Class Hierarchies
    6. 4.6. Copy and Move
    7. 4.7. Advice
  11. 5. Templates
    1. 5.1. Introduction
    2. 5.2. Parameterized Types
    3. 5.3. Function Templates
    4. 5.4. Concepts and Generic Programming
    5. 5.5. Function Objects
    6. 5.6. Variadic Templates
    7. 5.7. Aliases
    8. 5.8. Template Compilation Model
    9. 5.9. Advice
  12. 6. Library Overview
    1. 6.1. Introduction
    2. 6.2. Standard-Library Components
    3. 6.3. Standard-Library Headers and Namespace
    4. 6.4. Advice
  13. 7. Strings and Regular Expressions
    1. 7.1. Introduction
    2. 7.2. Strings
    3. 7.3. Regular Expressions
    4. 7.4. Advice
  14. 8. I/O Streams
    1. 8.1. Introduction
    2. 8.2. Output
    3. 8.3. Input
    4. 8.4. I/O State
    5. 8.5. I/O of User-Defined Types
    6. 8.6. Formatting
    7. 8.7. File Streams
    8. 8.8. String Streams
    9. 8.9. Advice
  15. 9. Containers
    1. 9.1. Introduction
    2. 9.2. vector
    3. 9.3. list
    4. 9.4. map
    5. 9.5. unordered_map
    6. 9.6. Container Overview
    7. 9.7. Advice
  16. 10. Algorithms
    1. 10.1. Introduction
    2. 10.2. Use of Iterators
    3. 10.3. Iterator Types
    4. 10.4. Stream Iterators
    5. 10.5. Predicates
    6. 10.6. Algorithm Overview
    7. 10.7. Container Algorithms
    8. 10.8. Advice
  17. 11. Utilities
    1. 11.1. Introduction
    2. 11.2. Resource Management
    3. 11.3. Specialized Containers
    4. 11.4. Time
    5. 11.5. Function Adaptors
    6. 11.6. Type Functions
    7. 11.7. Advice
  18. 12. Numerics
    1. 12.1. Introduction
    2. 12.2. Mathematical Functions
    3. 12.3. Numerical Algorithms
    4. 12.4. Complex Numbers
    5. 12.5. Random Numbers
    6. 12.6. Vector Arithmetic
    7. 12.7. Numeric Limits
    8. 12.8. Advice
  19. 13. Concurrency
    1. 13.1. Introduction
    2. 13.2. Tasks and threads
    3. 13.3. Passing Arguments
    4. 13.4. Returning Results
    5. 13.5. Sharing Data
    6. 13.6. Waiting for Events
    7. 13.7. Communicating Tasks
    8. 13.8. Advice
  20. 14. History and Compatibility
    1. 14.1. History
    2. 14.2. C++11 Extensions
    3. 14.3. C/C++ Compatibility
    4. 14.4. Bibliography
    5. 14.5. Advice
  21. Index