Cleanups 8: Deprecate <strstream>
classes instead of the entire header
#2680
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Deprecating the entire
<strstream>
header is problematic for the proposed Standard Library Modules, as<strstream>
is still Standard C++23 and must be part ofimport std;
.This change makes it so that merely including
<strstream>
no longer emits a deprecation warning (via the two-typedef trick). Instead, the deprecation is applied to the 4 classes within. The warning message is still appropriate:STL/stl/inc/yvals_core.h
Lines 787 to 790 in 314f65f
We must wrap the header in
_STL_DISABLE_DEPRECATED_WARNING
/_STL_RESTORE_DEPRECATED_WARNING
as the classes mention each other.I am not deprecating the non-Standard
swap()
overloads - there is little point in doing so when the Standard classes are already marked.I am also detaching comments on the classes.
Then, this allows
_SILENCE_CXX17_STRSTREAM_DEPRECATION_WARNING
to be removed in various places that were merely including<strstream>
but not attempting to use its machinery. (Silencing is still necessary intests/std/tests/P1502R1_standard_library_header_units
andtests/tr1/tests/strstream
which exercise the machinery.)Note that the "deprecate the entire header" technique is still being applied to the
<ccomplex>
,<cstdalign>
,<cstdbool>
, and<ctgmath>
headers, as they are super useless, removed in C++20, and I won't be adding them to Standard Library Modules. (<experimental/filesystem>
and<hash_meow>
have the even stronger#error
-unless-escape-hatch technique; they are non-Standard so they are also unchanged here.)