Entries by Rainer Grimm

My ALS Journey (17/n): Christmas Special

Today, I have a special Christmas gift. >> My ALS Journey so far << Make the Difference Let’s do something great together: From December 1st to 24th, when you book one of my mentoring programs, I will donate half of the money to ALS research. I will publish an update each week so we can […]

std::execution

std::execution, previously known as executors or Senders/Receivers, provides “a Standard C++ framework for managing asynchronous execution on generic execution resources“. (P2300R10) Side Note Change of plans. My original plan was to present the C++26 library after the core language. However, the implementation status of the library is not good enough. Therefore, I decided to continue […]

C++26 Core Language: Small Improvements

There are more small improvements in the C++26 language, which you should know. static_assert extension First, here’s the syntax of static_assert in C++11: static_assert(compile time predicate, unevaluated string) With C++26, the string can be a user-defined type having the following properties: static_assert can now be used with a format string. Here’s a nice example from […]

My ALS Journey (16/n): Good Bye Training / Hello Mentoring

In 2025, I will no longer offer C++ classes. Instead, I will only offer C++ mentoring in the future. >> My ALS Journey so far << Today’s report is very technical. I explain why I switched from training to mentoring. This switch is also due to the fact that I cannot integrate classes anymore in […]

Placeholders and Extended Character Set

Placeholders are a nice way to highlight variables that are no longer needed. Additionally, the character set of C++26 will be extended. Placeholders Structured bindings are a C++17 feature that allows you to bind multiple variables to the elements of a structured object. The following program demonstrates using tuples and structured bindings to return and […]

Contracts in C++26

Contracts allow you to specify preconditions, postconditions, and invariants for functions. Contracts should already be part of C++20 but were removed in the standard meeting in Cologne. Here is what Herb Sutter said about contracts on Sutter’s Mill: “contracts is the most impactful feature of C++20 so far, and arguably the most impactful feature we […]

Reflection in C++26: Determine the Layout

Thanks to reflection, you can determine the layout of types. My examples are based on the reflection proposal P2996R5. Class Layout The following program determines the class layout of a few members. // classLayout.cpp #include <experimental/meta> #include <iostream> #include <utility> #include <vector> #include <array> struct member_descriptor { std::size_t offset; std::size_t size; bool operator==(member_descriptor const&) const […]

My ALS Journey (15/n): A typical Day

You may wonder how my day looks. Let me compare a day before ALS with a current day >> My ALS Journey so far << A typical Day My day before ALS is not so exciting. A table will do the job. Currently, all has changed. Now, I have 24/7 support from 4 nurses, together […]

Reflection in C++26: Metafunctions for Enums and Classes

Today, I continue my journey through reflection in C++26 and play with enums and classes. The names of the metafunctions to access an Enum or a Class member are often identical. Access the Members of an Enum The following program is based on one by Daveed Vandevoorde. Daveed is one of the fathers of reflection, […]

Reflection in C++26: Metafunctions

Reflection offers many metafunctions that run at compile time. The metafunctions are declared as consteval. consteval creates a so-called immediate function. Each invocation of an immediate function creates a compile-time constant. To say it more directly. A consteval (immediate) function is executed at compile-time. Read more about consteval and constinit in my previous post: Two […]