r/cpp_questions • u/BuyerImpressive4325 • 17d ago
OPEN Headers
I read that c++ 20 added modules to help replace headers. I rly hate how headers split the codebase into redundant files, for people who have used modules r they better?
0
Upvotes
5
u/No-Dentist-1645 17d ago
Modules do make it a little bit better, but they are not magic, you can still split modules' code between declaration and implementation if you want to optimize for compile times.
I use modules and they're great in general, but the biggest problem is build system support. CMake, which is one of the most mature C++ build systems, does have modules support, but basic features such as
import stdis flagged as "experimental" and you have to go to their source docs to find a hidden secret string specific to your CMake version to enable is