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

Extract _Bitmask_includes_any(), _Bitmask_includes_all() from _BITMASK_OPS #2865

Merged
merged 2 commits into from
Jul 21, 2022

Conversation

StephanTLavavej
Copy link
Member

@StephanTLavavej StephanTLavavej commented Jul 15, 2022

The helper functions _Bitmask_includes() and _Bitmask_includes_all() can be templates instead of being stamped out for every enum bitmask. These functions are used for only a few types.

We need to add _STD qualification to callsites that are outside namespace std, as we're no longer stamping out overloads in the global namespace.

Also remove unnecessary comments (ignore whitespace to see this clearly).

Also rename _Bitmask_includes() to _Bitmask_includes_any() for clarity.

Found while implementing Standard Library Modules, but this was blocked until toolset update #2861 with the fix for internal VSO-1509503 "Standard Library Header Units: Deduplication interferes with ADL for global operator&".

…tmask_includes_all()`.

They can be templates instead of being stamped out for every enum bitmask.

Also remove unnecessary comments.
@StephanTLavavej StephanTLavavej added the throughput Must compile faster label Jul 15, 2022
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner July 15, 2022 02:24
Copy link
Member

@barcharcraz barcharcraz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change appears correct to me.

stl/inc/type_traits Outdated Show resolved Hide resolved
@StephanTLavavej StephanTLavavej changed the title Extract _Bitmask_includes(), _Bitmask_includes_all() from _BITMASK_OPS Extract _Bitmask_includes_any(), _Bitmask_includes_all() from _BITMASK_OPS Jul 15, 2022
@StephanTLavavej
Copy link
Member Author

@CaseyCarter @strega-nil-ms @barcharcraz Pushed the rename, updated title and PR description.

@StephanTLavavej StephanTLavavej self-assigned this Jul 19, 2022
@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 d4f9f06 into microsoft:main Jul 21, 2022
@StephanTLavavej StephanTLavavej deleted the bitmask_ops branch July 21, 2022 00:25
fsb4000 pushed a commit to fsb4000/STL that referenced this pull request Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
throughput Must compile faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants