Bitfield structs and suggestion

0ffh frank at frankhirsch.youknow.what.todo.net
Fri Nov 23 19:56:50 PST 2007


Richard Bradley wrote:
>> It's not a priority, it's something that could be added later without
>>  breaking anything -- just syntactic sugar, really. We can try again 
>> later <g>.
> 
> Curious, Has there been any movement on this issue? Is there a less
> error-prone way to do this other then manual shifts and masks?
> 
> [...]
> 
> Comments, ideas welcome. Richard

FWIW I am quite sympathetic to the cause of C-like bitfields for D.
My take on D in the context of Kelleher's "What languages fix" was
always "D: C++ is a syntactic mess, and built-in GC is a win.".

OTOH, the accessor templates from the D.learn thread look very nice.

The question is probably: Do we really need native bitfield support,
or is D mighty enough that a sufficient solution can be implemented
without resorting to adding to the language itself?
I think the answer may in part depend on the result of the planned
"GCC bitfields" vs. "GDC templates" shootout as planned on D.learn
by bearophile.

Hi bearophile, any results yet? :)

regards, frank



More information about the Digitalmars-d mailing list