[Issue 4425] More bells & whistles for bitfields

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 3 03:06:12 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=4425



--- Comment #4 from bearophile_hugs at eml.cc 2012-08-03 03:06:07 PDT ---
(In reply to comment #3)
> Adding const to a field seems pretty easy; specifically the setter is simply
> left out of the template.

OK.


> So as a final proposed usage, it would look like:
> 
>  mixin(bitfields(
>           int,  "named",           4,
>     const int,  "c_named",         4,
>           uint, "named_def=5",     4,    //includes defaulted value of 5
>     const uint, "c_named_def=10",  4));  //defaulted value of 10

Good. And what do you think about facing the endianess problems (Comment 2)?


>  bitfieldsOn is being worked on, and effectively works identically to bitfields
> except you specify a variable you want to use; Default values won't work well
> with it however.

What's bitfieldsOn?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list