Skip to content

Cleanups 4: quoted()#2676

Merged
StephanTLavavej merged 2 commits into
microsoft:mainfrom
StephanTLavavej:cleanups-4-quoted
May 1, 2022
Merged

Cleanups 4: quoted()#2676
StephanTLavavej merged 2 commits into
microsoft:mainfrom
StephanTLavavej:cleanups-4-quoted

Conversation

@StephanTLavavej
Copy link
Copy Markdown
Member

  • Avoid repeating types in quoted() by using return {m,e,o,w};.
    • The types are verbose, and the constructors are implicit. I considered this slightly more convenient/readable than returning auto.
  • Use char_traits::length() instead of a raw loop in quoted().
    • Please verify my claim that this does not change runtime behavior (we're getting the same answer, number of characters before the null terminator).
    • I think we might have thought that char_traits was unavailable, but it is totally available here, just through an epic-length chain of dependencies. Using char_traits is not only simpler, it has the potential to be faster for char (especially) and wchar_t.

@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Apr 27, 2022
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner April 27, 2022 20:55
@strega-nil-ms strega-nil-ms self-assigned this Apr 27, 2022
@CaseyCarter CaseyCarter removed their assignment Apr 28, 2022
Comment thread stl/inc/iomanip
@StephanTLavavej
Copy link
Copy Markdown
Member Author

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

@StephanTLavavej StephanTLavavej merged commit 311c59a into microsoft:main May 1, 2022
@StephanTLavavej StephanTLavavej deleted the cleanups-4-quoted branch May 1, 2022 10:38
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.

5 participants