Skip to content

🎨 Improvements for bitset - #418

Merged
elbeno merged 3 commits into
intel:mainfrom
elbeno:bitset-arg-fix
Sep 9, 2026
Merged

🎨 Improvements for bitset#418
elbeno merged 3 commits into
intel:mainfrom
elbeno:bitset-arg-fix

Conversation

@elbeno

@elbeno elbeno commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Problem:

  • bitset construction from a string_view uses substr which may throw, and it's a really niche use case anyway.
  • There's no need for for_each and transform to be friends of bitset since the member functions are public.
  • It's awkward that bitset<16> and bitset<16u> are different types.

Solution:

  • Remove bitset's string_view constructor.
  • Remove the friend declarations.
  • Fix the argument of bitset to a std::size_t in the cases it's not an enum.

Problem:
- `bitset` construction from a `string_view` uses `substr` which may throw, and
  it's a really niche use case anyway.

Solution:
- Remove it.
Problem:
- There's no need for `for_each` and `transform` to be `friend`s of `bitset`
  since the member functions are public.

Solution:
- Remove the `friend` declarations.
Problem:
- It's awkward that `bitset<16>` and `bitset<16u>` are different types.

Solution:
- Fix the argument of `bitset` to a `std::size_t` in the cases it's not an enum.
@elbeno
elbeno enabled auto-merge September 9, 2026 23:35
@elbeno
elbeno merged commit 8d42746 into intel:main Sep 9, 2026
48 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants