-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Casey's miscellaneous changes, definitive edition #5014
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
Define a new macro instead of conditionally inserting `_CONSTEXPR20`. Drive-by: Combine nested conditionals.
…_library_header_units`
Discovered this has been fixed in 19.1.0 after reducing a repro to file.
We had to workaround the fact that hidden friends aren't hidden in permissive mode by stuffing `unreachable_sentinel_t`'s `operator==` into a detail namespace. Now that the changes to C++20 relational expressions are implemented, we can use a member `operator==` instead of a `friend` to more simply achieve the same effect. See https://godbolt.org/z/x5ffjdxYf for a proof-of-concept.
* Remove nested type names that are extraneous in C++20 to help us avoid depending on the existence of said nested type names. * Always declare the "nested 5 iterator traits" (or the subset of them a given iterator provides) in canonical order at the top of the first public section in a class body. * When the "nested 5 iterator traits" _are_ available, use their names in the semantically appropriate places in member function declarations. For example, `reference operator*() const`.
For consistency with other algorithms that take unwrapped iterators.
`_Unchecked_begin`/`_Unchecked_end` are semi-documented, so their presence doesn't necessarily indicate a specialization is library-defined. Use our `_Is_from_primary` tech, and remove the now-unused `_Has_unchecked_begin_end`.
`_Uninitialized_copy`, `_Uninitialized_copy_n`, and `_Uninitialized_move` in `<xmemory>` are internal-only, and trust that the caller has passed arguments that denote a valid range. I am not so trusting. `_STL_INTERNAL_CHECK((_STD _Adl_verify_range(_First, _Last), true))` feels like a bit of a hack - I could be convinced to simply wrap the `_Adl_verify_range` call in `#ifdef _ENABLE_STL_INTERNAL_CHECK`.
"I don't need to redo the full test run; surely this small |
…te a range They must per N4988 [range.subrange.ctor] para 1 and 3. As a rule, we never verify that `[begin(meow), end(meow))` for a range `meow` actually denotes a range, so `subrange`'s constructors are the only chance we have to verify these user-supplied values.
StephanTLavavej
requested changes
Oct 14, 2024
tests/std/tests/GH_004109_iter_value_t_direct_initialization/test.compile.pass.cpp
Show resolved
Hide resolved
tests/std/tests/P2165R4_tuple_like_relational_operators/test.compile.pass.cpp
Outdated
Show resolved
Hide resolved
StephanTLavavej
approved these changes
Oct 14, 2024
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Miscellaneous thanks! 🐈 🐈⬛ 🧶 |
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.
Nice bite-sized commits:
Improve formatting of
_Default_allocate_traits
; define a new macro instead of conditionally inserting_CONSTEXPR20
. Drive-by: Combine nested conditionals.Fix
TRANSITION
comment for disabled EDG config inP1502R1_standard_library_header_units
.Annotate workaround for Clang constrained-friends issue with
TRANSITION, Clang 19
. I discovered this has been fixed in 19.1.0 after reducing a repro to file, didn't try to dig up the fix.Remove extraneous
constexpr
inP2502R2_generator
Simplify
unreachable_sentinel_t
. We had to workaround the fact that hidden friends aren't hidden in permissive mode by stuffingunreachable_sentinel_t
'soperator==
into a detail namespace. Now that the changes to C++20 relational expressions are implemented, we can use a memberoperator==
instead of afriend
to more simply achieve the same effect. See https://godbolt.org/z/x5ffjdxYf for a proof-of-concept.Uniformly annotate undefined members of fake iterators
Cleanup some iterator definitions
reference operator*() const
.Rename
_Merge_move
to_Merge_move_unchecked
for consistency with other algorithms that take unwrapped iterators.Improve detection of library-defined
array
specializations._Unchecked_begin
/_Unchecked_end
are semi-documented, so their presence doesn't necessarily indicate a specialization is library-defined. Use our_Is_from_primary
tech, and remove the now-unused_Has_unchecked_begin_end
.Add some internal checks to internal algorithms.
_Uninitialized_copy
,_Uninitialized_copy_n
, and_Uninitialized_move
in<xmemory>
are internal-only, and trust that the caller has passed arguments that denote a valid range. I am not so trusting._STL_INTERNAL_CHECK((_STD _Adl_verify_range(_First, _Last), true))
feels like a bit of a hack - I could be convinced to simply wrap the_Adl_verify_range
call in#ifdef _ENABLE_STL_INTERNAL_CHECK
.Verify that arguments to
subrange
's iter/sentinel constructors denote a range. They must per N4988 [range.subrange.ctor] para 1 and 3. As a rule, we never verify that[begin(meow), end(meow))
for a rangemeow
actually denotes a range, sosubrange
's constructors are the only chance we have to verify these user-supplied values.