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

Various cleanups #3533

Conversation

StephanTLavavej
Copy link
Member

@StephanTLavavej StephanTLavavej commented Mar 3, 2023

I've created a dozen PRs with changes grouped according to various themes for ease of reviewing. This is the remaining grab bag 😹 where it would be unproductive to decompose further. These changes are all targeted and simple.

  • Add braces to an if-statement in ppltasks.cpp.
    • We insist on bracing all control flow.
    • This is compatible with the if-statement being preprocessor-controlled.
  • Drop this-> when calling Base::meow().
    • The qualified call is sufficient. (We use this-> when reaching into dependent base classes. These cases are different because we're calling identically-named functions in the base class.)
  • Use _STL_INTERNAL_STATIC_ASSERT in invoke().
    • This presumably predated our introduction of test-only static_assert machinery. As "bug in invoke" indicated, if this ever activated, it would indicate an STL implementation bug, not bogus programmer-user inputs.
  • Move #include _STL_INTRIN_HEADER to the end so it doesn't interrupt clang-format sorting.
  • src/xmtx.hpp doesn't need push-pop defenses.
    • None of our src-internal headers have or need them.
  • xmath.hpp and xmtx.hpp should behave like the other src-internal headers and rely on #pragma once instead of idempotency macros.
    • I vaguely recall that xmath.hpp was user-visible a while ago, and xmtx.hpp might have been too, which would explain their different styles.
  • Mark _Pass_fn() as _NODISCARD.
    • We call this a lot. Would be a shame if someone discarded its return value.
  • _Ryu_exponent can be const.
    • This is a straightforward improvement that doesn't pose concerns for keeping the code in sync with upstream.
  • As @strega-nil-ms requested in Implement P2770R0 "Stashing stashing iterators for proper flattening" #3466 (comment) , I've moved the _Can_const_join workaround and _As_lvalue() up, to avoid separating join_view's primary template and specialization.

@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Mar 3, 2023
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner March 3, 2023 21:19
@StephanTLavavej StephanTLavavej self-assigned this Mar 7, 2023
@StephanTLavavej
Copy link
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 8499dc1 into microsoft:main Mar 7, 2023
@StephanTLavavej StephanTLavavej deleted the stl-cleanups-remaining-tiny-stuff branch March 7, 2023 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants