Re: bitfields - Default values?

2012-06-12 Thread Era Scarecrow
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

Re: bitfields - Default values?

2012-06-12 Thread Era Scarecrow
On Tuesday, 12 June 2012 at 13:05:26 UTC, bearophile wrote: Era Scarecrow: struct defs { mixin(bitfields_D!( bitfields!( //borrowed from std.bitmanip bool, "b", 1, uint, "i", 3, short, "s", 4), "i=2", "s=5")); } Are you able to support a syntax like: struct defs {

Re: bitfields - Default values?

2012-06-12 Thread Dmitry Olshansky
On 12.06.2012 17:05, bearophile wrote: Era Scarecrow: Are you able to support a syntax like: struct defs { mixin(bitfields!( bool, "b", 1, uint, "i=2", 3, short, "s=5", 4)); } Or iff bitfields is a mixin template: struct defs { mixin bitfields!( bool, "b", 1, uint, "i=2",

Re: bitfields - Default values?

2012-06-12 Thread bearophile
Era Scarecrow: struct defs { mixin(bitfields_D!( bitfields!( //borrowed from std.bitmanip bool, "b", 1, uint, "i", 3, short, "s", 4), "i=2", "s=5")); } Are you able to support a syntax like: struct defs { mixin(bitfields!( bool, "b", 1, uint, "i=

Re: bitfields - Default values?

2012-06-12 Thread Era Scarecrow
On Tuesday, 5 June 2012 at 00:17:08 UTC, bearophile wrote: Era Scarecrow: The documentation for bitfields doesn't go into detail if you can put any default values into it. Can you? I think you can't. See: http://d.puremagic.com/issues/show_bug.cgi?id=4425 Bye, bearophile K, I think I have

Re: bitfields - Default values?

2012-06-04 Thread bearophile
Era Scarecrow: The documentation for bitfields doesn't go into detail if you can put any default values into it. Can you? I think you can't. See: http://d.puremagic.com/issues/show_bug.cgi?id=4425 Bye, bearophile

bitfields - Default values?

2012-06-04 Thread Era Scarecrow
The documentation for bitfields doesn't go into detail if you can put any default values into it. Can you? It makes sense if you can that it would convert the whole thing into a single number (or or-ing the results into a single expression with shifting and all). From what I can tell it all