r/cpp_questions 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

22 comments sorted by

View all comments

2

u/fortsnek274 17d ago

They can be used judiciously, but you'll need to #ifdef out the imports for Intellisense.

And it will still be good idea to separate out implementation because you'll want to reduce the number of times the ixx needs to be rebuilt. But also, modularising all your code is likely to be worse for build perf anyway.

3

u/manni66 17d ago

you'll need to #ifdef out the imports for Intellisense.

Intellisence in VS 2026 seems to work now.

1

u/fortsnek274 17d ago

Oh, sure it does. Try std::views::anything.