Skip to content
Snippets Groups Projects
Unverified Commit 462a7f45 authored by Jonathan Wakely's avatar Jonathan Wakely Committed by Jonathan Wakely
Browse files

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.
parent 301a961f
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment