[Issue 6742] Alignments in std.variant.Algebraic

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jan 29 18:40:46 PST 2015


https://issues.dlang.org/show_bug.cgi?id=6742

AndyC <andy at squeakycode.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andy at squeakycode.net

--- Comment #3 from AndyC <andy at squeakycode.net> ---
In DMD 2.066.1, I get:


import std.variant: Algebraic;
static assert(double.alignof == 8); //  Error here, this should be 4.

struct Foo { double x; }
alias Algebraic!(Foo) AFoo1;
static assert(AFoo1.sizeof == 12);
struct AFoo2 {
    bool b;
    double x;
}
static assert(AFoo2.sizeof == 16);  // Error here, it should be 12.
void main() {}

I'm not sure what that means though.

--


More information about the Digitalmars-d-bugs mailing list