4 ms·
There have been a few proposals for advanced bit-packing stuff, but most of it has been postponed as back-compat for later. That said, by default enum/struct l
by Gankro 12y ago
There have been a few proposals for advanced bit-packing stuff, but most of it has been postponed as back-compat for later.
That said, by default enum/struct layout is undefined, so it's possible the compiler could be taught to optimize your usecase correctly. For instance Option<&T> is the same size as &T because &T is strictly non-zero, and we can therefore use 0 for None.