What a header actually does depends on compiler flags, #defines from other files and then the order in which you include things as one header file might define something that changes the behavior of another header file. The compiler loses state in between C++-files and caching precompiled header files was still a joke the last time I've checked.
That leads to the problem that every single C++ file needs to include a few hundred thousand lines of nested headers and compilation takes forever. Add in some templates and you get a lot duplicated code in the object files that needs to be weeded out by the linker. Sometimes it's even suggested to put all your classes into one single big C++ file and only compile that in order to get your compilation time down.
Having proper modules would do so much good!
Going away from C's linker and header file-model, which really doesn't work well for C++, to something based on a proper module system, would be amazing.
Having modules in C++ smells like the connector we're missing in order to accomplish something like that.
That single file is the substitute for a package that you can simply put somewhere, include it and it works.
So the substitute is much better than the package!
Can't explain why, but for C++ projects, I intuitively remember what paths I need for headers, but for a C# project, I rely upon autocomplete as a crutch. Maybe it's just how much more time I spend doing C++ work and the time I spend with the libraries I use vs the relatively small time I spend with C#.
You're misunderstanding me. I'm saying the IDE should discover headers for me. MSVC refers me to a Byzantine series of clicks, drop downs, text input, and OK buttons. That interface hasn't changed for 20 years
A proper modern UX would scan for valid headers in a dir, then allow me to choose which ones to "import" into the workspace. Not make me hunt for them through an antiquated and inefficient UI
Having a reasonable module system, and hell even some lovely tools for migrating sane projects over to it, would make me much happier with the language.
For what it's worth, Clang has experimental support for C++ modules.
The trouble being actually indexing the contents of any given module and trouble with template instantiation.
In C++, yeah, this language sucks.
That is totally opposite to my experience. Example from Linux:
https://github.com/torvalds/linux/blob/master/kernel/smpboot... https://github.com/torvalds/linux/blob/master/kernel/smpboot...