A tour of C++: Updated for C++ 20. 3 Ed

A tour of C++: Updated for C++ 20. 3 Ed

A tour of C++: Updated for C++ 20. 3 Ed
Автор: Stroustrup Bjarne
Дата выхода: 2023
Издательство: Pearson Education Limited
Количество страниц: 312
Размер файла: 15.8 MB
Тип файла: PDF
Добавил: codelibs
 Проверить на вирусы

Cover....1

Half Title....2

Title Page....4

Copyright Page....5

Contents....6

Preface....12

1 The Basics....14

1.1 Introduction....14

1.2 Programs....15

1.3 Functions....17

1.4 Types, Variables, and Arithmetic....18

1.5 Scope and Lifetime....22

1.6 Constants....23

1.7 Pointers, Arrays, and References....24

1.8 Tests....27

1.9 Mapping to Hardware....29

1.10 Advice....32

2 User-Defined Types....34

2.1 Introduction....34

2.2 Structures....35

2.3 Classes....36

2.4 Enumerations....38

2.5 Unions....40

2.6 Advice....41

3 Modularity....42

3.1 Introduction....42

3.2 Separate Compilation....43

3.3 Namespaces....48

3.4 Function Arguments and Return Values....50

3.5 Advice....55

4 Error Handling....56

4.1 Introduction....56

4.2 Exceptions....57

4.3 Invariants....58

4.4 Error-Handling Alternatives....60

4.5 Assertions....61

4.6 Advice....64

5 Classes....66

5.1 Introduction....66

5.2 Concrete Types....67

5.3 Abstract Types....73

5.4 Virtual Functions....75

5.5 Class Hierarchies....76

5.6 Advice....82

6 Essential Operations....84

6.1 Introduction....84

6.2 Copy and Move....87

6.3 Resource Management....91

6.4 Operator Overloading....93

6.5 Conventional Operations....94

6.6 User-Defined Literals....97

6.7 Advice....98

7 Templates....100

7.1 Introduction....100

7.2 Parameterized Types....101

7.3 Parameterized Operations....106

7.4 Template Mechanisms....112

7.5 Advice....115

8 Concepts and Generic Programming....116

8.1 Introduction....116

8.2 Concepts....117

8.3 Generic Programming....125

8.4 Variadic Templates....127

8.5 Template Compilation Model....130

8.6 Advice....130

9 Library Overview....132

9.1 Introduction....132

9.2 Standard-Library Components....133

9.3 Standard-Library Organization....134

9.4 Advice....137

10 Strings and Regular Expressions....138

10.1 Introduction....138

10.2 Strings....138

10.3 String Views....141

10.4 Regular Expressions....143

10.5 Advice....149

11 Input and Output....150

11.1 Introduction....150

11.2 Output....151

11.3 Input....152

11.4 I/O State....154

11.5 I/O of User-Defined Types....154

11.6 Output Formatting....156

11.7 Streams....159

11.8 C-style I/O....162

11.9 File System....163

11.10 Advice....167

12 Containers....170

12.1 Introduction....170

12.2 vector....171

12.3 list....175

12.4 forward_list....177

12.5 map....177

12.6 unordered_map....178

12.7 Allocators....180

12.8 Container Overview....181

12.9 Advice....183

13 Algorithms....186

13.1 Introduction....186

13.2 Use of Iterators....188

13.3 Iterator Types....191

13.4 Use of Predicates....194

13.5 Algorithm Overview....194

13.6 Parallel Algorithms....196

13.7 Advice....196

14 Ranges....198

14.1 Introduction....198

14.2 Views....199

14.3 Generators....201

14.4 Pipelines....201

14.5 Concepts Overview....203

14.6 Advice....207

15 Pointers and Containers....208

15.1 Introduction....208

15.2 Pointers....209

15.3 Containers....214

15.4 Alternatives....221

15.5 Advice....225

16 Utilities....226

16.1 Introduction....226

16.2 Time....227

16.3 Function Adaption....229

16.4 Type Functions....230

16.5 source_location....235

16.6 move() and forward()....236

16.7 Bit Manipulation....237

16.8 Exiting a Program....238

16.9 Advice....238

17 Numerics....240

17.1 Introduction....240

17.2 Mathematical Functions....241

17.3 Numerical Algorithms....242

17.4 Complex Numbers....243

17.5 Random Numbers....244

17.6 Vector Arithmetic....246

17.7 Numeric Limits....247

17.8 Type Aliases....247

17.9 Mathematical Constants....247

17.10 Advice....248

18 Concurrency....250

18.1 Introduction....250

18.2 Tasks and threads....251

18.3 Sharing Data....254

18.4 Waiting for Events....256

18.5 Communicating Tasks....258

18.6 Coroutines....263

18.7 Advice....266

19 History and Compatibility....268

19.1 History....268

19.2 C++ Feature Evolution....276

19.3 C/C++ Compatibility....281

19.4 Bibliography....284

19.5 Advice....287

Module std....290

A.1 Introduction....290

A.2 Use What Your Implementation Offers....291

A.3 Use Headers....291

A.4 Make Your Own module std....291

A.5 Advice....292

Index....294

A....295

B....296

C....297

D....299

E....300

F....301

G....302

H....302

I....302

J....303

K....304

L....304

M....304

N....305

O....306

P....306

Q....307

R....307

S....308

T....310

U....311

V....311

W....312

X....312

Y....312

Z....312

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.


Похожее:

Список отзывов:

Нет отзывов к книге.