A Tour of C++

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Note: manually re-edited to fix formatting. Fixed code samples to use monospace font and proper spacing. Reduced line lenght of code paragraphs to less than 70 (except a few cases). Removed all images that duplicated code paragraphs. Removed index since couldn't make it work. No content has been changed.


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.

Author(s): Bjarne Stroustrup
Series: C++ in Depth
Edition: 3
Publisher: Addison-Wesley Professional
Year: 2022

Language: English
Pages: 320
Tags: C++, C++20

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