Skip to content

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

Merged
Stephan T. Lavavej (StephanTLavavej) merged 2 commits into
microsoft:mainfrom
StephanTLavavej:bitmask_ops
Jul 21, 2022
Merged

Extract _Bitmask_includes_any(), _Bitmask_includes_all() from _BITMASK_OPS#2865
Stephan T. Lavavej (StephanTLavavej) merged 2 commits into
microsoft:mainfrom
StephanTLavavej:bitmask_ops

Conversation

@StephanTLavavej

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) commented Jul 15, 2022

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor

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.

Comment thread stl/inc/type_traits Outdated
@StephanTLavavej Stephan T. Lavavej (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
Copy Markdown
Member Author

Casey Carter (@CaseyCarter) nicole mazzuca (@strega-nil-ms) Charlie Barto (@barcharcraz) Pushed the rename, updated title and PR description.

@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
Stephan T. Lavavej (StephanTLavavej) merged commit d4f9f06 into microsoft:main Jul 21, 2022
Igor Zhukov (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