libstdc++: Move std::basic_ostream to new internal header [PR99995]
This adds <bits/ostream.h> so that other headers don't need to include all of <ostream>, which pulls in all of <format> since C++23 (for the std::print and std::println overloads in <ostream>). This new header allows the constrained operator<< in <bits/unique_ptr.h> to be defined without all of std::format being compiled. We could also replace <ostream> with <bits/ostream.h> in all of <istream>, <fstream>, <sstream>, and <spanstream>. That seems more likely to cause problems for users who might be expecting <sstream> to define std::endl, for example. Although the standard doesn't guarantee that, it is more reasonable than expecting <memory> to define it! We can look into making those changes for GCC 16. libstdc++-v3/ChangeLog: PR libstdc++/99995 * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * include/bits/unique_ptr.h: Include bits/ostream.h instead of ostream. * include/std/ostream: Include new header. * include/bits/ostream.h: New file.
Showing
- libstdc++-v3/include/Makefile.am 1 addition, 0 deletionslibstdc++-v3/include/Makefile.am
- libstdc++-v3/include/Makefile.in 1 addition, 0 deletionslibstdc++-v3/include/Makefile.in
- libstdc++-v3/include/bits/ostream.h 814 additions, 0 deletionslibstdc++-v3/include/bits/ostream.h
- libstdc++-v3/include/bits/unique_ptr.h 1 addition, 1 deletionlibstdc++-v3/include/bits/unique_ptr.h
- libstdc++-v3/include/std/ostream 1 addition, 762 deletionslibstdc++-v3/include/std/ostream
Loading
Please register or sign in to comment