Entries by Rainer Grimm

C++23: A New Way of Error Handling with std::expected

C++23 extends the interface of std::optional and gets the new data type std::expected for error handling. Before I dive into the extended monadic interface of std::optional in C++23, I want to introduce this C++17 type. std::optional std::optional is quite comfortable for calculations such as database queries that may have a result. This vocabulary type requires […]

C++23: A Modularized Standard Library, std::print and std::println

The C++23 standard library has very impressive improvements. In this post, I will write about the modularized standard library and the two convenience functions std::print and std::println. The new “Hello World” Each programming challenge in a new language starts with the “Hello World” program. Since C++98, this was our starting point: #include <iostream> int main() […]

60 terrible tips for a C++ developer

Today, I want to present a mini book written Andrey Karpov from the PVS-Studio team. This book is educational and entertaining at the same time. The mini book contains 60 terrible coding tips — and explanations of why they are terrible. It’s a lot of fun to read them. The horrible tips are not fictional […]

C++ Parallel STL Benchmark

Today, I’m happy to present a guest post from Victor J. Duvanenko about my favorite C++17 feature: the parallel STL algorithms. Victor has published a book about “Practical Parallel Algorithms in C++ and C#“. Without further ado, here is Victor guest post: C++ includes a standard set of generic algorithms, called STL (Standard Template Library). […]

C++23: More Small Pearls

With the static multidimensional subscript and call operator, the C++23 core language has more to offer. auto(x) and auto{x} In my last post, “C++23: The Small Pearls in the Core Language“, I gave a concise explanation of auto(x) and auto{x}: The calls auto(x) and auto{x} cast x into a prvalue as if passing x as […]

My New Blog

My blog Modernes C++ is over seven years old and needed a redesign. Here it is. I hope you like it. If you want to know my motivation for my migration, read the following paragraph. If not, skip it and read the last chapter about your feedback. My Motivation for the Migration You may wonder […]

C++23: The Small Pearls in the Core Language

The C++23 core language has more to offer than deducing this. Today, I will write about the small pearls. Literal Suffixes C++23 provides new integral literal suffixes for (signed) std::size_t: Literal Suffix Type Example z or Z signed std::size_t auto signed = -2023z; z/Z and u/U std::size_t auto unsigned = 2023uz, std::size_t (C++17) is an […]