Use the til::enumset type in place of std::bitset in the SgrStack implementation #16046

Open
opened 2026-01-31 04:55:53 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (Dec 4, 2021).

Description of the new feature/enhancement

The SgrStack implementation currently uses a std::bitset type to track which of the attribute values are saved in each stack entry. Since the set index is an enum type, this requires a lot of casting when testing and setting the bitset. Replacing that bitset with a til::enumset should make the code a little bit cleaner.

Here's a sample of the kind of code I'm talking about:
fb597ed304/src/types/sgrStack.cpp (L143-L153)

Proposed technical implementation details (optional)

Replace the std::bitset with a til::enumset and eliminate all the unnecessary casts.

I should add that I'm happy to put together a PR for this if there are no objections.

Originally created by @j4james on GitHub (Dec 4, 2021). # Description of the new feature/enhancement The `SgrStack` implementation currently uses a `std::bitset` type to track which of the attribute values are saved in each stack entry. Since the set index is an enum type, this requires a lot of casting when testing and setting the `bitset`. Replacing that `bitset` with a `til::enumset` should make the code a little bit cleaner. Here's a sample of the kind of code I'm talking about: https://github.com/microsoft/terminal/blob/fb597ed304ec6eef245405c9652e9b8a029b821f/src/types/sgrStack.cpp#L143-L153 # Proposed technical implementation details (optional) Replace the `std::bitset` with a `til::enumset` and eliminate all the unnecessary casts. I should add that I'm happy to put together a PR for this if there are no objections.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16046