OK, I'm stumped on this one: dstep, struct, mixin, bitfields

Ali Çehreli acehreli at yahoo.com
Wed Mar 21 18:14:11 UTC 2018


On 03/21/2018 11:00 AM, Russel Winder wrote:
 > The code I am playing with generated by DStep involves lots of lots of
 > structs with mixin bitfields. All of them seem to compile file, except
 > one. How is it that:
 >
 >      mixin(bitfields!(
 >          ubyte, "current_next", 1,
 >          ubyte, "version", 5,
 >          ubyte, "one2", 2)); /* TS ID */
 >
 > can result in the following error. The line for "version" is 141 and
 > the one for "one2" is 142.

I think it's because 'version' is a D keyword. :)

Ali



More information about the Digitalmars-d-learn mailing list