1 struct Data2 2 { 3 char buffer; 4 } 5 filename(const ref Data2 d)6@property const(char)[] filename(const ref Data2 d) pure nothrow 7 { 8 return (&d.buffer)[0 .. 1]; 9 } 10 filename2(const Data2 * d)11@property const(char)[] filename2(const Data2* d) pure nothrow 12 { 13 return (&d.buffer)[0 .. 1]; 14 } 15 main()16void main() 17 { 18 Data2 d; 19 string f = d.filename; 20 string g = (&d).filename2; 21 d.buffer = 'a'; 22 } 23