Delete std::experimental::erase/erase_if#4470
Merged
StephanTLavavej merged 9 commits intomicrosoft:mainfrom Mar 16, 2024
Merged
Delete std::experimental::erase/erase_if#4470StephanTLavavej merged 9 commits intomicrosoft:mainfrom
std::experimental::erase/erase_if#4470StephanTLavavej merged 9 commits intomicrosoft:mainfrom
Conversation
…erase/erase_if`. We're still testing `std::erase/erase_if`. Move `auto pr1` and `vector<bool> vb` within `#if _HAS_CXX20` to avoid any potential unused-variable warnings. (We surely instantiate `vector<bool>` elsewhere, so we're not giving up any test coverage here.)
This was copy-pasted for `// 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. The test coverage for `P0458R2 contains()` used the final contents of the ordered/unordered associative containers, so I'm defining them with copy-list-initialization to match the `const` containers below.
CaseyCarter
approved these changes
Mar 13, 2024
Member
Author
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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_ifwere 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 bothvectorandexperimental/vector), but my real motivation is modules - onlystd::erase/erase_ifare available through the Standard Library Modules, so we should encourage users to write Standard code. (Whilestd::erase/erase_ifare 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_iteratorwere 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 pr1andvector<bool> vbwithin#if _HAS_CXX20to 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 theconstcontainers below._HAS_CXX20regions.-Wunused-parameterwarnings.