Reduce the amount of content included by <array>#482
Merged
BillyONeal merged 6 commits intomicrosoft:masterfrom Feb 21, 2020
Merged
Reduce the amount of content included by <array>#482BillyONeal merged 6 commits intomicrosoft:masterfrom
BillyONeal merged 6 commits intomicrosoft:masterfrom
Conversation
Resolves microsoftGH-462. * Demote `back_inserter` and `iterator` to `<iterator>`. * Demote `_Yarn` to `<xlocinfo>`. * Demote `_Tidy_guard`, `_Tidy_deallocate_guard`, and `_Nothrow_compare` to `<xmemory>`. * Promote `_Swap_ranges_unchecked` to `<xutility>`. * Change `<array>` to include only `<xutility>`.
Member
Author
|
Some of these changes might have to be scaled back depending on what comes back from the Microsoft-internal "RWC" test system. (That is, if too much real world code is broken) |
Member
Author
|
@ned14 I hope you're happy :) |
StephanTLavavej
approved these changes
Feb 5, 2020
CaseyCarter
approved these changes
Feb 5, 2020
StephanTLavavej
approved these changes
Feb 6, 2020
Member
Author
|
OK, results from RWC back:
Investigating submitting upstream patches in these projects. |
Member
Author
|
Given that most of the projects are broken by min/max I'm going to make the following changes:
|
…ome from <array>. * Remove the `_STL_ASSERT` from `std::min` and `std::max`. We normally guard every `op<` with debug checks, but in this case we aren't using it to enforce something like a container invariant; the number of bad op<s we catch with it are likely microscopic. * Delete `_Min_value` and `_Max_value` from `<utility>`. * Move `min` and `max` to `<utility>` (in the exact position as the old `_Min_value` and `_Max_value`) * Change all existing callers of `_Min_value` and `_Max_value` to call `(_STD min)` and `(_STD max)`, respectively.
CaseyCarter
approved these changes
Feb 7, 2020
StephanTLavavej
approved these changes
Feb 7, 2020
This was referenced Feb 7, 2020
4 tasks
fengjixuchui
added a commit
to fengjixuchui/STL
that referenced
this pull request
Feb 21, 2020
Reduce the amount of content included by <array> (microsoft#482)
StephanTLavavej
added a commit
to AdamBucior/STL
that referenced
this pull request
Mar 4, 2020
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.
Resolves GH-462.
Made the following changes to have fewer dependencies from
<array>:back_inserterto<iterator>._Yarnto<xlocinfo>._Tidy_guard,_Tidy_deallocate_guard, and_Nothrow_compareto<xmemory>._Swap_ranges_uncheckedto<xutility>.<array>to include only<xutility>.This broke several real world code projects that only included
<array>and calledstd::minorstd::max. Therefore, the following workarounds were applied:_STL_ASSERTfromstd::minandstd::max. We normally guard everyop<with debug checks, but in this case we aren't using it to enforce something like a container invariant; the number of bad op<s we catch with it are likely microscopic._Min_valueand_Max_valuefrom<utility>.minandmaxto<utility>(in the exact position as the old_Min_valueand_Max_value), except for theinitializer_listoverloads._Min_valueand_Max_valueto call(_STD min)and(_STD max), respectively.Checklist
_Uglyas perhttps://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
verified by an STL maintainer before automated testing is enabled on GitHub,
leave this unchecked for initial submission).
members, adding virtual functions, changing whether a type is an aggregate
or trivially copyable, etc.).
the C++ Working Draft (including any cited standards), other WG21 papers
(excluding reference implementations outside of proposed standard wording),
and LWG issues as reference material. If they were derived from a project
that's already listed in NOTICE.txt, that's fine, but please mention it.
If they were derived from any other project (including Boost and libc++,
which are not yet listed in NOTICE.txt), you must mention it here,
so we can determine whether the license is compatible and what else needs
to be done.