-
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
Miscellaneous Cleanups #3178
Miscellaneous Cleanups #3178
Conversation
Make `transform_view::iterator::_Verify_offset` always `noexcept` by avoiding checks when the underlying iterator doesn't support `_Verify_offset`. Make that function and `elements_view::iterator::_Verify_offset` available only when `_IDL != 0` **fixing a bug in `elements_view::iterator`**. Remove the now unused `_NOEXCEPT_IDL0` machinery. Fixes microsoft#1269
... to `if (cond) y(); else x();` Drive-by: Let's `static_assert` only when running the test suite.
* Simplify nested requirement in `HasPeek` * Remove excess empty line
... from `instantiator::call`. Reduces compile + run time by 27%.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (obviously, fix the red cross)
I've pushed a commit to fix the test failures because Additionally, I split it into two static assertions, partially to make things line up nicer, but also to follow our usual guidance to assert X and Y separately instead of |
transform_view iterators are validated only when the underlying iterators are.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for finding and fixing these issues! 🏚️ 🧹 🏡 |
Mostly things I noticed while reviewing the last import batch at the last minute that were not worth resetting testing for, but does include a couple of "old" changes as well.
Separate commits to ease review:
basic_string::_Move_construct_from_substr
already knows the allocator": avoids passing an allocator to this member function which can simply retrieve the stored allocator._Verify_offset(-n)
against-INT_MIN
" (in<ranges>
): we had a couple of places that guarded against overflow negating the argument to_Verify_offset
, we should do so consistently._NOEXCEPT_IDL0
": Removes this variation innoexcept
between debug and release builds - it was a terrible idea. Maketransform_view::iterator::_Verify_offset
alwaysnoexcept
by avoiding checks when the underlying iterator doesn't support_Verify_offset
. Make that function andelements_view::iterator::_Verify_offset
available only when_IDL != 0
fixing a bug inelements_view::iterator
that disabled the check. Remove the now unused_NOEXCEPT_IDL0
machinery. Fixes <ranges>: Questionable conditional noexcept #1269.<execution>
": Fixes <execution>: Consider separating type and data member declarations #330.<system_error>
: Correctif (!cond) x(); else y()
": ... toif (cond) y(); else x();
. Drive-by: Let'sstatic_assert
only when running the test suite.tests/P2278R4_basic_const_iterator
nitpicks":HasPeek
tests/P2322R6_ranges_alg_fold
: factor out non-dependent tests": ... from the dependent test cases ininstantiator::call
. Reduces compile + run time by 27%.