Entries by Rainer Grimm

C++20: The Three-Way Comparison Operator

The three-way comparison operator <=> is often just called the spaceship operator. The spaceship operator determines whether A < B, A = B, or A > B for two values, A and B. You can define the spaceship operator, or the compiler can auto-generate it.

C++20: Further Open Questions to Modules

So far, I have written in my last four posts the basics you should know about modules in C++20. Only a few questions about modules are still open. In this post, I address these open questions, such as templates in modules, the linkage of modules, and header units.

C++20: Structure Modules

When your module becomes bigger, you want to divide its functionality into manageable components. C++20 modules offer two approaches: submodules and partitions. Let me discuss both approaches in this post.

C++20: A Simple math Module

Modules are one of the four prominent features of C++20. They overcome the restrictions of header files and promise a lot: faster build-times, fewer violations of the One-Definition-Rule, less usage of the preprocessor. Today, I want to create a simple math module.

C++20: The Advantages of Modules

Modules are one of the four big features of C++20: concepts, ranges, coroutines, and modules. Modules promise a lot: compile-time improvement, isolation of macros, the abolition of header files, and ugly workarounds.