-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce the amount of content included by <array> #482
Merged
Merged
Conversation
This file contains 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
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>`.
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) |
@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
OK, results from RWC back:
Investigating submitting upstream patches in these projects. |
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
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_inserter
to<iterator>
._Yarn
to<xlocinfo>
._Tidy_guard
,_Tidy_deallocate_guard
, and_Nothrow_compare
to<xmemory>
._Swap_ranges_unchecked
to<xutility>
.<array>
to include only<xutility>
.This broke several real world code projects that only included
<array>
and calledstd::min
orstd::max
. Therefore, the following workarounds were applied:_STL_ASSERT
fromstd::min
andstd::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_value
and_Max_value
from<utility>
.min
andmax
to<utility>
(in the exact position as the old_Min_value
and_Max_value
), except for theinitializer_list
overloads._Min_value
and_Max_value
to call(_STD min)
and(_STD max)
, respectively.Checklist
_Ugly
as 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.