Understanding C++ Module Units
abuehl.github.io·5h·
Discuss: r/cpp
Flag this post

C++ modules again! Do you use them? We’re using them for our UML Editor (Windows, MSVC).

At first glance, C++ modules look like they are easy to understand. After all, we all have been used to use header files for decades now, it can’t possibly be more difficult than header files, can it?

Yes, it can!

C++ modules are nice, but there are… footguns!

Let’s have a closer look at the C++ module basics again. As professionals, we really need to fully understand what we do. So, please, carefully read on.

In C++20 (and later) we can define a primary module interface unit using the keywords export module.

Here is an example (file A-interface.ixx):

export module A;

namespace A
{

export int f(i...

Similar Posts

Loading similar posts...