Reader Testimonials....8
English Edition....8
German Edition....8
Introduction....11
Purpose of this Book....11
Index....11
Conventions....11
Source Examples....12
Source Code....13
Value versus Object....13
Acknowledgments....13
Further Information....13
Cippi....14
About Me....14
1. The Standard Library....16
The History....16
Overview....17
Use of Libraries....24
2. Utilities....29
Useful Functions....29
Adaptors for Functions....35
Pairs....37
Tuples....38
Reference Wrappers....40
Smart Pointers....41
Type Traits....51
Time Library....58
std::any, std::optional, and std::variant....67
std::expected....73
3. Interface of All Containers....77
Create and delete....78
Size....80
Access....81
Assign and Swap....82
Compare....83
Erasure....84
4. Sequence Containers....86
Arrays....88
Vectors....88
Deques....90
Lists....91
Forward Lists....92
5. Associative Containers....96
Overview....96
Ordered Associative Containers....99
Unordered Associative Containers....103
6. Container Adaptors....108
Linear Containers....108
Associative Containers....112
7. Views....114
Contiguous Access....114
Multidimensional Access....118
8. Iterators....124
Categories....125
Iterator Creation....126
Useful Functions....128
Adaptors....130
9. Callable Units....134
Functions....135
Function Objects....135
Lambda Functions....137
10. Algorithms....139
Conventions....140
Iterators are the Glue....141
Sequential, Parallel, or Parallel Execution with Vectorisation....141
for_each....144
Non-Modifying Algorithms....145
Modifying Algorithms....149
Partition....157
Sort....159
Binary Search....160
Merge Operations....161
Heaps....163
Min and Max....164
Permutations....166
Numeric....166
Unitialized Memory....170
11. Ranges....172
Range....173
View....175
Range Adaptors....175
Direct on the Containers....180
Function Composition....181
Lazy Evaluation....182
std Algorithms versus std::ranges Algorithms....184
12. Numeric....186
Random Numbers....186
Numeric Functions Inherited from C....189
Mathematical Constants....190
13. Strings....193
Create and Delete....195
Conversion Between C++ and C Strings....197
Size versus Capacity....198
Comparison....200
String Concatenation....200
Element Access....201
Input and Output....202
Search....203
Check for a substring....206
Modifying Operations....207
Numeric Conversions....209
14. String Views....213
Create and Initialise....214
Non-modifying operations....215
Modifying operations....216
15. Regular Expressions....218
Character Types....219
Regular Expression Objects....220
The Search Result match_results....221
Match....224
Search....225
Replace....226
Format....227
Repeated Search....229
16. Input and Output Streams....232
Hierarchy....232
Input and Output Functions....233
Streams....242
User-defined Data Types....249
17. Formatting Library....251
Formatting Functions....251
Syntax....253
Format specification....254
User-defined formatter....256
18. Filesystem....259
Classes....261
Non-member functions....264
File types....269
19. Multithreading....273
Memory Model....273
Atomic Data Types....273
Threads....278
Stop Token....282
Shared Variables....284
Thread Local Data....290
Condition Variables....291
Semaphores....292
Coordination Types....294
Tasks....296
20. Coroutines....301
Awaitables....303
An Infinite Data Stream with co_yield....303
Index....306
With the current C++23 standard, C++ has many libraries to offer. My book's key idea is to give you concise the necessary information for all C++ standard libraries."The C++ Standard Library" provides a detailed overview of the C++ Standard Library, including C++23.
The C++ Standard Library aims to provide you with a concise reference of the C++ standard library in about 350 pages. This book assumes that you are familiar with C++. If so, you will get the most benefit from this book. If C++ is new to you, you should start with a textbook about core C++. Once you have mastered a textbook about the core language, you can make your next big step by reading my book.
C++23 improved the big four of C++20: extended ranges functionality, the coroutine generator std::generator, and a modularized C++ standard library.The Standard Template Library (STL) consists of three components from a bird’s-eye view. Those are containers, algorithms that run on the containers, and iterators that connect both of them. The containers have only minimal requirements for their elements. This abstraction of generic programming enables you to combine algorithms and containers uniquely. The C++ Standard Library has a rich collection of containers. We have sequence and associative containers. Associative containers can be classified as ordered or unordered associative containers.
This book also has more than 100 running code examples for the code snippets I present. Therefore, you can combine theory with practice and get the most out of it.