-
Notifications
You must be signed in to change notification settings - Fork 260
Extend std C++ include header list (fix #692) #693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks! To make it easier for me to track what's being added, I went ahead and sorted the list myself (I think? it's been a long Sunday, please also fix any ordering oversights). So if you could please update the PR then I can see what headers are being added in the diff. |
f02aad5
to
b9b5bf9
Compare
@hsutter Sure. Done. |
// Otherwise, we're not in -pure-cpp2 and so just #include | ||
// what we need in this header to make this self-contained |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now this comment isn't true anymore.
Ah, now I see what you're doing... I think you're suggesting that even non- |
Thanks @fedapo ! The original reason to provide the entire standard library in The reason I provided a way to include all std headers was as a fallback path for compilers that didn't have real module import yet (most of them) or C++23 I've tried out the suggestion here, and I'm seeing that However, I see value in providing a way to include the entire standard library even in non-pure-cpp2 mode, so I'm going to try out providing it as command line options. The idea is to make it "zero-overhead," i.e., let users can pay for the additional compilation work only if they ask for it:
So now a mixed-Cpp1-and-Cpp2 file can easily opt into the convenience of either importing (fast!) or including (wait a couple of extra seconds) the entire standard library. Note I'll push that commit instead of this PR, but it was directly inspired by this. Again, thanks @fedapo ! |
@hsutter Thanks for the notice. |
And misc. cleanup
The new list is taken from the CPP2_USE_MODULES case and sorted alphabetically. This is a bit repetitive and could have been avoided, but I chose not to mess with the preprocessor if-else logic. I can change it, should several voices prefer that.