bitfields - Default values?
Era Scarecrow
rtcvb32 at yahoo.com
Tue Jun 12 10:39:02 PDT 2012
On Tuesday, 12 June 2012 at 15:51:31 UTC, Era Scarecrow wrote:
> On Tuesday, 12 June 2012 at 13:05:26 UTC, bearophile wrote:
>> Are you able to support a syntax like:
>>
>>> struct defs {
>>> mixin(bitfields!(
>>> bool, "b", 1,
>>> uint, "i=2", 3,
>>> short, "s=5", 4));
>>> }
>
> That does look cleaner and better IMO. At this second I'm not
> sure. I was trying not to interfere with the original bitfield
> generator.
Good news, I _can_ do that very format. Not too much complexity
and it seems to work okay, and it's definitely cleaner. Got some
testing yet to do, but it looks good to me..
More information about the Digitalmars-d-learn
mailing list