Property discussion wrap-up

TommiT tommitissari at hotmail.com
Wed Jan 30 09:42:47 PST 2013


On Wednesday, 30 January 2013 at 17:02:44 UTC, Zach the Mystic 
wrote:
> [..] 1) How hard to implement structs nested in structs to 
> mimic ones nested in functions?

Given:

struct Outer {
     struct Inner {
         int n1;
     }
     int n2;
}

Outer.sizeof should be equal to 2 * int.sizeof, because there's 
no point in introducing any overhead here. Whereas structs inside 
functions do their magic by having an implicit pointer, which 
increases their size. I don't think we want to introduce any 
memory overhead with something as insignificant as properties.


More information about the Digitalmars-d mailing list