On Monday, 14 September 2026 at 10:51:38 UTC, realhet wrote:
Hi! I try to make the easiest syntax for manipulating bits.

Update: This way I it works, but I think I'm abusing it.

```d
auto asBits(D)(ref D data)
{
static if(__traits(compiles, data = data)) return BitsRefSlice!D(&data, 0, D.sizeof*8);
        else    return BitsValSlice!D(data, 0, D.sizeof*8);
}
auto asBits(D)(D data)
=> BitsValSlice!D(data, 0, D.sizeof*8);
```

Somebody please tell me what's the best practice for this.

Reply via email to