Consider allowing conversion from bits type to structs, or some destructuring pattern
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
[Noted by Traster on HackerNews](https://news.ycombinator.com/item?id=24356329), it could be convenient to have bits values be convertible into the bitfields of a struct for convenience purposes, and to mimic the convenience of this common operation in Verilog.
Since all of our structs are conceptually packed, we'd just need to define the field order (MSb to LSb field) and bits-within-the-field order, perhaps instead of using `as` for conversion in a cast style, we could make this ordering more explicit, or perhaps there's a globally sensible default, since Verilog always had the (generally considered "wart" or "trap") of permitting `[0:X]` and `[X:0]` syntaxes to be confused.
Contributor guide
Assessment
This issue has not been assessed yet.