Delete std::experimental::erase/erase_if
#4470
Merged
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.
My
std::experimental::erase/erase_if
were deprecated by #236 implementingstd::erase/erase_if
, merged on 2019-11-01. This shipped on 2020-03-16 as part of VS 2019 16.5. Users have had 4 years of deprecation notice, and this machinery was always marked as experimental. It's time to follow through on our promise. This slightly reduces our surface area (making our repo and VS installations slightly smaller, avoiding the slight navigation headache of having bothvector
andexperimental/vector
), but my real motivation is modules - onlystd::erase/erase_if
are available through the Standard Library Modules, so we should encourage users to write Standard code. (Whilestd::erase/erase_if
are C++20, any users who eagerly reached for experimental TS machinery should be expected to have eagerly upgraded their Standard mode. Users can also write simple fallbacks if upgrading their Standard mode is somehow impractical, described below.)Aside: The equally MS-deprecated
<experimental/filesystem>
,<hash_meow>
, andstdext::checked_array_iterator
were much more widely used (unlike<cvt/meow>
, which was never documented and which I believe was virtually unused outside of our test suite, hence #4458 removing it), and they involve types, not just functions likeerase/erase_if
. (Accordingly, I don't think it's feasible to remove those types until vNext.) While the experimental Uniform Container Erasure functions probably got a bit of use, removing these functions is a non-event for ABI, and migration is very simple to deal with. (Either upgrade to C++20 and use the Standard functions, or fall back to classicerase-remove[_if]
forvector
-like containers, memberremove[_if]
forlist
-like containers, or a node removal loop for associative containers.)Structured commits:
erase/erase_if
(9 files, 11,814 bytes).std::experimental::fundamentals_v2::erase/erase_if
.std::erase/erase_if
.auto pr1
andvector<bool> vb
within#if _HAS_CXX20
to avoid any potential unused-variable warnings. (We surely instantiatevector<bool>
elsewhere, so we're not giving up any test coverage here.)std::experimental::erase/erase_if
.// P1209R0 erase_if(), erase()
below, further enhanced to inspect the return values that were added to the Standard, so we aren't losing any test coverage.P0458R2 contains()
used the final contents of the ordered/unordered associative containers, so I'm defining them with copy-list-initialization to match theconst
containers below._HAS_CXX20
regions.-Wunused-parameter
warnings.