-
Notifications
You must be signed in to change notification settings - Fork 260
Incomplete list of standard lib C++ headers in non-module case #692
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
Comments
Based on the commit you sent, the section that you're looking at is commented like this:
That @hsutter Is it expected that you need the |
Yes, that's right. Right now it's
|
So then it seems that the current behavior is expected, and if you aren't using the flag, then you still need to include these things manually to use them. |
Ah, I see the confusion. Yes, CPP_MODULES has two effects now: It uses modules, and (because module import is fast) it also does What I'm now hearing is that having the whole standard library always available is so useful that including all standard headers should happen whether using headers or modules, and it doesn't seem to be affecting compile times significantly. Correct? |
Here are the wall clock times (best of 4)
|
That's adding 1.2s to 2s per file, that seems like a lot comparatively speaking. |
Here are my results (average of 10 runs) comparing No flags,
Modules are fast! |
This is not an equivalent comparison. Here are the wall clock times (best of 4)
|
@JohelEGP am I reading that last table correctly as saying that, compared to bringing in the entire standard library via
? |
BTW it seems that means |
It's currently experimental and opt-in via CMake: https://libcxx.llvm.org/Modules.html#using-in-external-projects.
That's right. |
An important clarification is that it imports a module |
I don't understand... what is the difference between that and |
Yes: https://github.com/JohelEGP/cppfront/blob/cpp_modules/source/cpp2util.cpp2. |
So that module-import data does import the entire standard library (because it does |
That's right. |
File
cpp2util.h
has the list of headers of the C++ standard library to implement the Cpp2 feature of an always-on standard library. This list is repeated in a few branches of a pre-processor if-else statement to allow pre and post C++23 build scenarios.The non-module, pre-C++23 list is incomplete.
I suggest to make this list as complete as the other case and, possibly, sort the headers alphabetically of quicker checking whether an item is missing.
I'm aware that this list is temporary and the steady-state solution is a simple
import std;
, still, it'd be nice to be able to run some tests withcppfront
with today's compilers for a larger class of cases.The text was updated successfully, but these errors were encountered: