Unify locale helpers with if constexpr by StephanTLavavej · Pull Request #5923 · microsoft/STL (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation1 Commits15 Checks45 Files changed

Conversation

This file contains hidden or 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

[ Show hidden characters]({{ revealButtonHref }})

@StephanTLavavej

Works towards #189.

Commits

@StephanTLavavej

__CRTDECL (_LStr(coll|xfrm)|_Makloc(byte|chr|str)|_Getloctxt) => $1

These functions aren't dllexported or address-taken, so their calling convention doesn't matter.

@StephanTLavavej

@StephanTLavavej

@StephanTLavavej

@StephanTLavavej

…rm()`, following GH 5444.

@StephanTLavavej

@StephanTLavavej

…h #ifdef _CRTBLD.

This follows _LStrcoll and _LStrxfrm, changed by GH 5361.

@StephanTLavavej

…d of a typed null pointer.

This is fine because it can't be deduced now.

These are header-only (and aren't extern "C") and their signatures are changing, so we don't need to rename them.

@StephanTLavavej

@StephanTLavavej

@StephanTLavavej

…rtbld_ushort`.

remove_cv_t<_Elem> is currently unnecessary, but it makes me feel better to have type traits that behave like the primary type categories.

@StephanTLavavej

_Count is unused at this point (and there's no outer loop).

@StephanTLavavej

_Count can be scoped to the for-loop. _Count1 can be const. _Wchars and _Ptr1 can be initialized when defined, instead of assigned at the beginning of the for-loop.

@StephanTLavavej

_Bytes doesn't communicate information across loops or loop iterations. It's always assigned to in the loop body, then read from at the end of the iteration. Making it a const local in each loop iteration is significantly clearer.

@StephanTLavavej

Users with real wchar_t should never see this.

@StephanTLavavej

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

zacklj89

Labels

2 participants

@StephanTLavavej @zacklj89