r/cpp • MSVC user, r/cpp_modules • Mar 23 '26

Using MSVC's C++ Module Partitions

https://abuehl.github.io/2026/03/23/using-ms-partitions.html

A follow-up to my recent posting in r/cpp.

10 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/tartaruga232 MSVC user, r/cpp_modules Mar 25 '26

I see. But then you need

bar.cppm:

export module foo:bar;

bar1.cpp:

module foo:bar.impl1;
import :bar;

bar2.cpp:

module foo:bar.impl2;
import :bar;

Looks ugly to me. It feels like there's something missing in the standard.

I keep using the (non-standard) Microsoft extension for now. Less hacky and already implemented in Microsoft's C++ compiler. We do not use CMake, so I don't care if CMake doesn't support it.