Can we finally use C++ Modules in 2026?

18 points by raymii


FrostKiwi

Using modules exclusively now, including import std. The ecosystem is almost there. Big compilers [1] agreeing to back port it to C++20 and foundational libs like vulkan hpp supporting it [2]. There are still misunderstandings with build system integration [3] and clangd still needs a full recompile before it sees an update to a module, which messes with productivity. I for one, am not going back.

[1] https://github.com/microsoft/STL/issues/1694#:~:text=informal%20agreement

[2] https://github.com/KhronosGroup/Vulkan-Hpp?tab=readme-ov-file#v14334

[3] https://gitlab.kitware.com/cmake/cmake/-/work_items/27706

scanner_brightly

No.

I tried to convert a project to C++ modules recently and had to abandon it because I was getting a mismatch between clangd bundled with my IDE and clang tools being used by my project. The intermediate formats involved aren't standardized and can change between releases of clang so it's quite brittle. My IDE just showed hundreds of nonsensical errors.

LesleyLai

I've started to use Modules in one of my projects. So far, it's been a smooth experience, but I haven't used import std or any libraries using it. Probably import std will be the biggest friction to adopting modules at the current stage.

kaycebasques

IntelliNonSense

Sensible chuckle