Bitfield structs and suggestion

Richard Bradley darthalias at yahoo.com
Thu Nov 22 17:36:44 PST 2007


> 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?

I am looking to write an open-source generic library for hardware design, I thought D would make a much better base then C++. I'm a big fan of what I've seen so far. Sorry to say, but D can't be a serious low-level contender without bitfield support.

I'm not talking about using it once or twice in a project, but thousands of structures for each project, and each structure having dozens of bitfields. Having to do masks and shifts just seems like a nightmare of bad code. 

I can't imagine my friends on the firmware side (or any low-level developer) wouldn't agree. 

Miles' idea of making D somehow order aware would be a huge win for this close-to-the-hardware stuff. Or even non-order aware bitfields at least isn't worse then what's allready out there.

Comments, ideas welcome.
Richard





More information about the Digitalmars-d mailing list