Implicit enum conversions are a stupid PITA

Walter Bright newshound1 at digitalmars.com
Thu Mar 25 02:38:25 PDT 2010


Nick Sabalausky wrote:
> Actually, with "bitfields", I've been mostly referring to pretty much just 
> that: doing manual bit-twiddling, typically aided by manifest constants 
> and/or enums, and taking the stance that doing that could use a better (ie, 
> more abstracted and more type-safe) interface (while still keeping the same 
> under-the-hood behavior).
> 
> Maybe it's all the low-level stuff I've done, but any time I come across the 
> term "bitfield" I instinctively envision those abstract rows of labeled 
> "bit" squares (or differently-sized rectangles) that you see in spec sheets 
> for digital hardware (ie, the abstract concept of a small piece of memory 
> having bit-aligned data), rather than specifically the 
> structs-with-sub-byte-member-alignment that I keep forgetting C has. I can't 
> really comment on that latter kind as I've never really used them (can't 
> remember why not), although I can easily believe that they may be 
> insufficient for the job. Maybe that difference is where the disagreement 
> between me and Andrei arose.


It does seem we've totally misunderstood each other. Yes, I was referring to 
(and I'm sure Andrei was as well) the C bitfield language feature.



More information about the Digitalmars-d mailing list