C++17 STL Cookbook Notes
Chapter 1 The New C++17 Features1.1 structured bindings
Structured bindings can be used to unpack pair, tuple, struct and even array of fixed size.
...
Modern C++ Programming Cookbook Notes 7: Stream, Robustness and Idioms
Chapter 7 Working with files and streams7.4 Using I/O manipulators to control the output of a stream
Standard provides many helper functions called ...
Modern C++ Programming Cookbook Notes 6: General Purpose Utilities
Chapter 6 General Purpose Utilities6.1 Expressing time intervals with chrono::duration
C++11 provides a chrono library to deal with data and time. I ...
Modern C++ Programming Cookbook Notes 5: Standard Library Containers, Algorithms and Iterators
Chapter 5 Standard Library Containers, Algorithms and Iterators5.1 Using vector as a default container
Use std::vector as the default container unle ...
Modern C++ Programming Cookbook Notes 4: Preprocessor and Compilation
Chapter 4 Preprocessor and Compilation4.1 Conditionally compiling your source code
Use #if (#ifdef, #ifndef), #elif, #else and #endif to perform con ...
Modern C++ Programming Cookbook Notes 3: Exploring Functions
Chapter 3 Exploring Functions3.1 Defaulted and deleted functions
=default; can be applied to special class member functions while =delete; can be ap ...
Modern C++ Programming Cookbook Notes 2: Working with Numbers and Strings
Chapter 2 Working with Numbers and Strings2.1 Converting between numeric and string types
Use std::to_string() to convert a numeric (including integ ...
Modern C++ Programming Cookbook Notes 1: Learning Modern Core Language Features
Chapter 1 Learning Modern Core Language Features1.1 Using auto whenever possible
In C++11, we can use auto to define local variables and specify ret ...
Concurrency with Modern C++ Notes 2: Multithreading
Chapter 2 Multithreading2.1 Threads
std::thread has no copy operations. It accepts a callable as work package, whose return value is ignored.
The cr ...
Concurrency with Modern C++ Notes 1: Memory Model
Chapter 1 Memory Model1.1 Basics of the Memory Model
A memory location is:
an object of an scalar type (arithmetic type, pointer, enumeration type ...