[PR #10492] Add an enum-compatible bitset class. #28082

Open
opened 2026-01-31 09:26:12 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/10492

State: closed
Merged: Yes


Summary of the Pull Request

This introduces a new TIL class that is equivalent in functionality to a std::bitset, but where the positions in the bitset are enum values. It also has a few additional methods allowing for setting and testing multiple positions at the same time. The idea is that this class could be used in place of the WI_SetFlag and WI_IsFlagSet macros when working with sets of flags.

PR Checklist

Validation Steps Performed

I've added a few unit tests that verify the behaviour of all the new methods that aren't part of std::bitset. I've also tried it out as a replacement for the GridLines enum used in the renderer, and confirmed that it has all the functionality needed to replace that cleanly.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/10492 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This introduces a new TIL class that is equivalent in functionality to a `std::bitset`, but where the positions in the bitset are enum values. It also has a few additional methods allowing for setting and testing multiple positions at the same time. The idea is that this class could be used in place of the `WI_SetFlag` and `WI_IsFlagSet` macros when working with sets of flags. ## PR Checklist * [x] Closes #10432 * [x] CLA signed. * [x] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [x] I've discussed this with core contributors already. Issue number where discussion took place: #10432 ## Validation Steps Performed I've added a few unit tests that verify the behaviour of all the new methods that aren't part of `std::bitset`. I've also tried it out as a replacement for the `GridLines` enum used in the renderer, and confirmed that it has all the functionality needed to replace that cleanly.
claunia added the pull-request label 2026-01-31 09:26:12 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28082