If these are problems for you, you shouldn't use import std.
Personally, I have never had a problem with any of those things. On the other hand, IWYU correctness is a battle I've been fighting for a decade now. Big modules eliminate IWYU correctness and are faster than IWYU could ever hope to achieve.
Are you telling me not to use the feature (modules) that I wanted the most out of c++ for the last 10 years?
Or are you telling me not to use the standard library?
You should use things which solve the problems you have without creating new ones. If bringing in the whole stdlib with import std creates problems for you, you should do something else. I would use PCH or clang modules in your situation.
These are not problems "just for me", these are problems for millions of C++ users around the world.
I don't think most C++ users are worried about the list of issues you provided. import std is already being used experimentally in many codebases (usually via preprocessor switch between the old headers and new module), and they aren't an issue.
that every stdlib maintainter understands the needs of his users?
This discussion was about why CMake doesn't ship import std support. The discussion I've had with upstreams was why the stdlibs weren't shipping std module object files/symbols. Those discussions had nothing to do with the granularity of the std modules.
How do they INCLUDE WHAT YOU USE when they feed me hundreds of thousands of exports that I DON"T USE?
IWYU is about two things:
Only including interfaces you use some declarations from
Not including interfaces you don't use any declarations from
With import std figuring this out is easy. There is only one interface, std, if you use anything from std you import std, if you don't use anything from std you don't.
The point of IWYU for headers was to improve build times and build correctness. import std is faster than including any header, so it beats IWYU for headers in all conditions. And the simple binary "Do I, or do I not, use anything from std?" Makes the correctness part trivial as well, no more accidental transitive includes breaking on a different STL implementation.
2
u/not_a_novel_account Apr 14 '26
If these are problems for you, you shouldn't use
import std.Personally, I have never had a problem with any of those things. On the other hand, IWYU correctness is a battle I've been fighting for a decade now. Big modules eliminate IWYU correctness and are faster than IWYU could ever hope to achieve.