[Issue 9766] align(n) with n compile-time constant

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu May 5 00:04:48 PDT 2016


jiki at red.email.ne.jp changed:

           What    |Removed                     |Added
                 CC|                            |jiki at red.email.ne.jp

--- Comment #4 from jiki at red.email.ne.jp ---
My quick workaround is:

mixin template AlignedStr(int algn, string name, string memberlist) {
    enum fmt = "align(%d) struct %s { %s }";
    mixin( format(fmt, algn, name, memberlist) );

/* struct Foo */ mixin AlignedStr!(16, "Foo", q{
    char a;
    char b;

Yes, string mixin is power.


More information about the Digitalmars-d-bugs mailing list