Skip to content
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> (microsoft#482) #38

Merged
merged 5 commits into from
Feb 21, 2020

Conversation

fengjixuchui
Copy link
Owner

Description

Checklist

Be sure you've read README.md and understand the scope of this repo.

If you're unsure about a box, leave it unchecked. A maintainer will help you.

  • Identifiers in product code changes are properly _Ugly as per
    https://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
  • The STL builds successfully and all tests have passed (must be manually
    verified by an STL maintainer before automated testing is enabled on GitHub,
    leave this unchecked for initial submission).
  • These changes introduce no known ABI breaks (adding members, renaming
    members, adding virtual functions, changing whether a type is an aggregate
    or trivially copyable, etc.).
  • These changes were written from scratch using only this repository,
    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.

JeanPhilippeKernel and others added 5 commits February 7, 2020 16:02
* Add tests/std.

* Update other files.

NOTICE.txt
Mention the LLVM Project, as its code appears
in tests/std/tests/P0220R1_optional/test.cpp and elsewhere.

azure-devops/enforce-clang-format.cmd
Process everything within tests. This includes libcxx, std, and tr1.

docs/cgmanifest.json
Update this file for Microsoft-internal purposes. (It records the commit
hashes of repos whose source code we've incorporated into our own repo.
For llvm-project, this is distinct from the submodule's current commit.)

tests/tr1/run.pl
Mention runbe.pl in lowercase, to match the file itself.

* Improve run.pl and runbe.pl comments.
Includes:
* concepts `three_way_comparable` and `three_way_comparable_with`,
* type trait `std::compare_three_way_result` (with `_t` alias), and
* function object `compare_three_way`.

in `<compare>`, and:

* function objects `ranges::equal_to` and `ranges::less` (in `<xutility>` for
  easy algorithm access), `ranges::not_equal_to`, `ranges::less_equal`,
  `ranges::greater`, and `ranges::greater_equal` (in `<functional>`),
* slight refactoring of concept definitions in `<concepts>` to avoid redundant
  requirements for the single-type comparison concepts `equality_comparable`,
  `totally_ordered`, and `three_way_comparable`,
* heavy refactoring of the trait `common_comparison_category` (and `_t` alias)
  in `<compare>` to requires only `n + c` template instantiations instead of `cn`
  template instantiations,
* ======== ABI BREAK =========== remove the `_Is_unordered` member from
  `std::partial_ordering` in `<compare>` since (a) it's true if and only if the
  stored value has a particular value, and (b) Clang expects all of the
  comparison category types to have size 1,
* reorder all `is_transparent` alias declarations in the STL to be after the
  corresponding `operator()` to agree with synopsis order.

Also adds a new test `P0896R4_P1614R2_comparisons` that exercises the above.

The ABI BREAK sounds scary - as it should - but note that:
* this is a `/std:c++latest` feature, which is subject to change,
* objects of comparison category type aren't typically stored,
* only MSVC has released `<compare>` so far, so it's not widely used.
Altogether, it's extremely unlikely that anyone has encoded this in ABI.
* Reduce the amount of content included by <array>.

Resolves GH-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>`.

* Un-demote iterator.

* Workaround many RWC projects that expected std::min and std::max to come 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.

* Homogenize vector algorithm guards.
@fengjixuchui fengjixuchui merged commit a955263 into fengjixuchui:master Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants