Entries by Rainer Grimm

A Concise Introduction to Coroutines by Dian-Lun Lin

Today, I will start a miniseries about a scheduler for tasks. The starting point of this miniseries is a straightforward scheduler by Dian-Lun Lin that becomes increasingly sophisticated. I have already written around 15 posts about coroutines. They explain the theory about coroutines and apply this theory in various ways. However, I still fight for […]

The Ranges Library in C++20: More Design Choices

The ranges library in C++20 made due to performance reasons a few unique design choices. These choices have consequences: cache issues and constness issues. Here is a short reminder. In my last post, “The Ranges Libray in C++20: Design Choices“, I presented this possible implementation of std::ranges::filter_view: if constexpr (!ranges::forward_range<V>) return /* iterator */{*this, ranges::find_if(base_, […]

The Ranges Library in C++20: Design Choices

Thanks to the ranges library, working with the Standard Template Library (STL) is much more comfortable and powerful. First of all, the algorithms of the ranges library are lazy, can work directly on the container, and can be composed. Additionally, the ranges library made a few unique design choices, you must know. Before I dive […]

My very Serious Progressive Nerve Condition

I am sorry to inform you that I have ALS, a very serious progressive nerve condition. Therefore, I am unsure how long I can continue this blog. Currently, I can only travel to trainings or conferences with the help of my wife. We (my family and I) have decided to deal aggressively with this challenge. […]

C++20: More Details about Module Support of the Big Three

In my last post, “C++20: Module Support of the Big Three“, I compiled a simple module with the Big Three. Today, I drill deeper using the GCC, Clang, and Microsoft Compiler. Honestly, this post will be pretty technical and end with a curious note. Additionally, it requires basic modules knowledge. If you don’t have it, […]

C++20: Module Support of the Big Three

I have written almost 100 posts about C++20 in the last four years, but I’m not done. This post continues my story about C++20. Modules are one of the Big Four in C++20. In my C++20 classes, they are one of the main topics. Sadly, the implementation in GCC and Clang was way behind the […]

Optimization with Allocators in C++17

Thanks to polymorphic allocators in C++17, you can optimize your memory allocation. This optimization includes performance and the reuse of memory. Performance The following program is from cppreference.com/monotonic_buffer_resource. I will explain and extend its performance test to Clang and the MSVC compiler. // pmrPerformance.cpp // https://en.cppreference.com/w/cpp/memory/monotonic_buffer_resource #include <array> #include <chrono> #include <cstddef> #include <iomanip> #include […]

Special Allocators with C++17

I introduced in my last post “Polymorphic Allocators with C++17” the theory of polymorphic allocators in C++17. Today, I will apply the theory. Before I go on, here are the essential parts of my last post: “Polymorphic Allocators with C++17“. A Short Reminder The following program uses polymorphic allocators. // polymorphicAllocator.cpp #include <array> #include <cstddef> […]

Polymorphic Allocators in C++17

This post starts a miniseries about an almost unknown feature in C++17: polymorphic allocators. I often promised that I would write about polymorphic allocators. Today, I fulfill my promise. Since C++98, you can fine-tune memory allocation in general but also for user-defined types or containers of the standard library. For example, the containers of the […]

C++23: Ranges Improvements and std::generator

C++20 does not provide concrete coroutines, but C++20 provides a framework for implementing coroutines. This changes with C++23. std::generator is the first concrete coroutine. std::generator is part of the extension of the ranges library in C++23. So, let me start this post with the ranges library in C++20 and its extension in C++23. I will […]