KEMBAR78
Reduce inclusion for IO stream headers in C++23 by frederick-vs-ja · Pull Request #4936 · microsoft/STL · GitHub
Skip to content

Conversation

@frederick-vs-ja
Copy link
Contributor

Recently, I was informed that <complex> indirectly included <format> (in C++23 mode). In C++23, <ostream> needs almost all contents in <format> due to the print function family, so it's reasonable for <ostream> to include <format> since C++23. However, it doesn't seem necessary for some other IO stream headers and <complex> to indirectly include <format>.

Note that <syncstream> and <iostream> are required to include <ostream> by the Standard, so it's perhaps impossible to reduce inclusion for them. This PR splits a new internal header <__msvc_ostream.hpp> from <ostream> and leaves no any other public header to include the whole <ostream>.

⚠️ MSVC-internal changes are needed for the new internal header <__msvc_ostream.hpp>.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner September 4, 2024 17:57
@CaseyCarter CaseyCarter added the throughput Must compile faster label Sep 4, 2024
@StephanTLavavej StephanTLavavej self-assigned this Sep 4, 2024
@StephanTLavavej

This comment was marked as resolved.

@StephanTLavavej StephanTLavavej removed their assignment Sep 4, 2024
@StephanTLavavej StephanTLavavej self-assigned this Sep 4, 2024
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 1749e33 into microsoft:main Sep 9, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

Thanks for noticing this throughput regression and figuring out how to mitigate it! 🚀 🐇 😸

@frederick-vs-ja frederick-vs-ja deleted the fmt-inclusion-1 branch September 9, 2024 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

throughput Must compile faster

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants