<locale>: Hide some non-Standard functions of locale::id by frederick-vs-ja · Pull Request #5067 · 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

Conversation7 Commits4 Checks39 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 }})

frederick-vs-ja

The non-Standard constructor and conversion function are likely to change the behavior of overload resolution, so perhaps they should be eliminated. But they're currently appearing in the DLL interface and thus can't be removed until vNext.

This PR attempts to make them only exist when building the STL. The newly added Standard default constructor and _Get_index function are templates to avoid alternating DLL interface. (I'm still unsure whether this is sufficient or necessary.)

@frederick-vs-ja frederick-vs-ja changed the title<xlocale>: Hide some non-Standard functions from locale::id <xlocale>: Hide some non-Standard functions of locale::id

Nov 6, 2024

@frederick-vs-ja

The non-Standard constructor and conversion function are likely to change the behavior of overload resolution, so perhaps they should be eliminated. But they're currently appearing in the DLL interface and thus can't be removed until vNext.

This PR attempts to make them only exist when building the STL. The newly added Standard default constructor and _Get_index function are templates to avoid alternating DLL interface. (unsure whether this is sufficient or necessary)

@frederick-vs-ja frederick-vs-ja changed the title<xlocale>: Hide some non-Standard functions of locale::id <locale>: Hide some non-Standard functions of locale::id

Nov 6, 2024

@StephanTLavavej

The newly added Standard default constructor and _Get_index function are templates to avoid alternating DLL interface. (I'm still unsure whether this is sufficient or necessary.)

When a class is separately compiled, as class _CRTIMP2_PURE_IMPORT id is, then any ordinary member functions will be separately compiled and dllexported.

As always, you can check by running dumpbin /exports on the DLL and comparing before-and-after.

Edit: This change is special because of the default argument (review comment incoming).

StephanTLavavej

StephanTLavavej

@StephanTLavavej

Thanks! 🐈 I pushed a commit to fix bincompat, plus a couple of minor commits. This is moderately risky but I'm willing to roll the dice.

@StephanTLavavej

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

@StephanTLavavej

Looks like we avoided rolling snake eyes!

⛔ 🐍 🎲 🎲

2 participants

@frederick-vs-ja @StephanTLavavej