3 ms·
I recall that Herb Sutter's C++ Metaclasses proposal has an example of bitfield metaclass [1]. Zig's design is reasonable if it also makes use of those non-2^k-
by lifthrasiir 8y ago
I recall that Herb Sutter's C++ Metaclasses proposal has an example of bitfield metaclass [1]. Zig's design is reasonable if it also makes use of those non-2^k-bit integer types in other places, and indeed it does (e.g. alignment is commonly `u29`). However if it is not doable, I think Sutter's design (auto-generated overlay on normal integers) makes more sense.
[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0707r0.pdf#page=26 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p070...