C++ 20: The Core Language
My last post C++20: The Big Four started with an overview of concepts, ranges, coroutines, and modules. Of course, C++20 has more to offer. Today, let’s continue my overview of the core language.
This author has not written his bio yet.
But we are proud to say that Rainer Grimm contributed 702 entries already.
My last post C++20: The Big Four started with an overview of concepts, ranges, coroutines, and modules. Of course, C++20 has more to offer. Today, let’s continue my overview of the core language.
This post presents you the big four: concepts, ranges, coroutines, and modules.
I have prepared the pdf bundle. To get it is quite simple.
C++20 will be the next big C++ standard after C++11. As C++11 did, C++20 will change the way we program modern C++. This change is particularly true for Ranges, Coroutines, Concepts, and Modules. To understand this next big step in the evolution of C++, let me put it in this post in the historical context of […]
I’m happy to announce. I added a new chapter to lock-based concurrent data structures to my book “Concurrency with Modern C++”. Now, you get 550 pages of concurrency in C++ and more than 140 runnable examples. Here is more info: https://leanpub.com/concurrencywithmodernc
The C++ core guidelines have about twenty naming and layout rules. A few of them are obvious; a few of them may be controversial. Let’s see what I mean.
The lifetime safety profile in the C++ core guidelines boils down to one issue: don’t dereference a possible invalid pointer. A pointer may be invalid because it is not initialized or the nullptr. A pointer may also point beyond its rage or to a deleted object.
Today’s post concerns the second C++ Core Guidelines: Bounds Safety profile. The goal of the profile bounds safety is that you operate inside the bounds of allocated memory.
What does that mean: type safety by design. Type safety by design just means that you always initialize your variables, use std::variant instead of a union, or prefer variadic templates and fold expressions to va_arg‘s.
The C++ core guidelines support three profiles: type safety, bounds safety, and lifetime safety. Thanks to the guideline support library (GSL), you can check your code against these profiles. Today, I start with the profile type safety.
