Skip to content
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

LWG-3878 import std; should guarantee initialization of standard iostreams objects #3436

Closed
StephanTLavavej opened this issue Feb 12, 2023 · 2 comments
Labels
LWG Library Working Group issue modules C++23 modules, C++20 header units resolved Successfully resolved without a commit

Comments

@StephanTLavavej
Copy link
Member

LWG-3878 import std; should guarantee initialization of standard iostreams objects

Need to investigate whether our iostreams machinery achieves this automatically, or if we need to do something special for Standard Library Modules. It sure seems like I can use cout normally.

@StephanTLavavej StephanTLavavej added LWG Library Working Group issue modules C++23 modules, C++20 header units labels Feb 12, 2023
CaseyCarter added a commit to CaseyCarter/STL that referenced this issue Feb 13, 2023
…t recursion

We implemented an earlier version of the resolution, this is the final version approved by WG21.

Fixes microsoft#3436
@CaseyCarter
Copy link
Contributor

cout works fine with no dynamic initializer in the TU for std::ios_base::Init. We use some #pragma init_seg(compiler) trickery to ensure that cout et al. are initialized before dynamic initializers run. This is all true for both modules and non-modules builds.

@StephanTLavavej StephanTLavavej added the resolved Successfully resolved without a commit label Feb 13, 2023
@StephanTLavavej
Copy link
Member Author

Thanks, that explains it. I think we can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LWG Library Working Group issue modules C++23 modules, C++20 header units resolved Successfully resolved without a commit
Projects
Status: Done
Development

No branches or pull requests

2 participants