Skip to content

🎨 Add bitset::operator= from std::uint64_t - #420

Merged
lukevalenty merged 1 commit into
intel:mainfrom
elbeno:bitset-overwrite
Sep 11, 2026
Merged

lukevalenty merged 1 commit into
intel:mainfrom
elbeno:bitset-overwrite

Conversation

@elbeno

@elbeno elbeno commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Problem:

  • It's annoying to have to write:
bs = decltype(bs){0b1010u};

when you wanted to write:

bs = 0b1010u;

but can't because bitset's single-argument constructor is explicit.

Solution:

  • Add an assignment operator from std::uint64_t to match the constructor.

@elbeno
elbeno force-pushed the bitset-overwrite branch 2 times, most recently from 791c1f4 to b3f1360 Compare September 11, 2026 14:47
Problem:
- It's annoying to have to write:

```cpp
bs = decltype(bs){0b1010u};
```

when you wanted to write:

```cpp
bs = 0b1010u;
```

but can't because `bitset`'s single-argument constructor is explicit.

Solution:
- Add an assignment operator from `std::uint64_t` to match the constructor.
@lukevalenty
lukevalenty merged commit 0934abd into intel:main Sep 11, 2026
27 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