www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19987] New: std.variantN wastes space

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

          Issue ID: 19987
           Summary: std.variantN wastes space
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: john.loughran.colvin gmail.com

Because the function pointer is stored before the union and for anything other
than small sizes the union is larger (and has larger alignment), if you ask for
a size of 24 you get 48 as the total size, as opposed to 32 if the fptr and
union order is swapped.

--
Jun 19 2019