[Issue 11883] [feature request] align attribute without value defaults to largest supported alignment.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 8 09:27:04 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11883


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2014-01-08 09:26:57 PST ---
align without an argument will re-set the alignment to default, which may be
useful in some situations:

-----
struct Foo
{
align(8):
    short a;
    short b;
    short c;
align:
    short d;
}

void main()
{
    pragma(msg, Foo.a.offsetof);  // 0
    pragma(msg, Foo.b.offsetof);  // 8
    pragma(msg, Foo.c.offsetof);  // 16
    pragma(msg, Foo.d.offsetof);  // 18
}
-----

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


More information about the Digitalmars-d-bugs mailing list