http://bugzilla.gdcproject.org/show_bug.cgi?id=226

--- Comment #4 from thomas.bock...@gmail.com ---
I found a workaround:
---
struct Foo(A, B)
{
    align(max(A.sizeof, B.sizeof)) union
    {
        A a;
        B b;
    }

    static assert (typeof(this).sizeof  >= max(A.sizeof,  B.sizeof));
    static assert (typeof(this).alignof >= max(A.alignof, B.alignof));
}
---
It would need Kenji's "align(n) with n compile-time constant" PR to work
without string mixins, though:
    https://github.com/dlang/dmd/pull/5750

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to