Entries by Rainer Grimm

The Formatting Library in C++20: The Format String

I introduced “The Formatting Library in C++20” in my last post. Today, I will dive deeper into the format specification of the format string. Let me start with a short recap of the format string. The format string FormatString consists of A replacement field has the format { }. Argument ID You can use an […]

Printed Version of “Concurrency with Modern C++” on Amazon

I have some great news. First, you finally have “Concurrency with Modern C++” on Amazon; second, my book includes C++23. The book has about 700 pages and more than 200 examples. Get the Printed Book: US, UK, DE, FR, ES, IT, NL, PL, SE, JP, CA, and AU Get the Source Code: https://github.com/RainerGrimm/ConcurrencyWithModernCpp (more than 200 […]

The Formatting Library in C++20

Today, I will start a series about the formatting library in C++20. The series is based on my C++20 book. Although Peter Gottschling wrote two great blog posts about the formatting library in C++20 (“std::format in C++20“, “C++20: Extend std::format for User-Defined Types“, I will write about the formatting library again. The reason is simple: […]

My ALS Journey: 4/n

In the last three weeks, a lot happened. I was in the ALS-Ambulanz in Ulm and started a money-raising campaign. Business as Usual After the Christmas break, business as usual is back. I am giving a 3-day Python class this week, teaching the basics and object orientation with Python. I have a long Python history […]

std::span in C++20: More Details

A std::span represents an object that refers to a contiguous sequence of objects. Today, I want to write about its not-so-obvious features. A std::span, sometimes also called a view, is never an owner. This contiguous memory can be a plain array, a pointer with a size, a std::array, a std::vector, or a std::string. A typical […]

Our Money-Raising Campaign for ALS Research

Get my 3-book bundle Modern C++ Collection for half the price ($70 -> $35). I will donate the money to the ALS research. Donation sum so far: $5800. Let me start with the facts. Research around ALS is Heavily Underfunded Here is a statement from the ALS-Ambulanz, translated into English: ALS is one of the […]

The autogenerated Equality Operator

You can define the three-way comparison operator or request it from the compiler with =default. But do you know that you can also define or request the equality operator in C++20? Before I dive into the autogenerated equality operator, I’d like to refresh your knowledge about the three-way comparison operator. The Three-Way Comparison Operator You […]

My ALS Journey: 3/n

Here is what happened in the last three weeks. Let me start with a very thoughtful Christmas present. Brief Answers to the Big Questions by Stephen Hawking My son Marius gave me the Christmas present “Brief Answers to the Big Questions” by Stephen Hawking. I’m very curious to read it. You may know it. Stephen […]

The Second Edition of my C++20 Book on Amazon

I have given many C++20 classes in the last two years and improved my C++20 knowledge. Consequentially, I updated my C++20 book. This update includes restructured chapters, more detailed information, and additional examples. The book now has almost 700 pages and more than 200 examples. This issue is the final one. I’m done and will […]

A Coroutines-Based Single Consumer – Single Producer Workflow by Ljubic Damir

I’m happy to present in this guest post by Ljubic Damir a typical use-case for coroutines: a producer – consumer workflow. Although this producer-consumer workflow is challenging, it is a nice starting point for your coroutine experiments. Intro Coroutines provide a more intuitive and structured way of writing asynchronous code by allowing you to write […]