fork(2) download
  1.  
  2. import std.stdio;
  3.  
  4. struct Test
  5. {
  6. @property ref int x()
  7. {
  8. return vals[0];
  9. }
  10.  
  11. @property ref int j(int v)
  12. {
  13. return (vals[0] = v);
  14. }
  15.  
  16.  
  17. private int[2] vals;
  18.  
  19. }
  20.  
  21. void main()
  22. {
  23. Test t;
  24.  
  25. writeln(typeof(&t.x).stringof);
  26. writeln(typeof(&t.x()).stringof);
  27. writeln(typeof(&(t.x = 10)).stringof);
  28. writeln(typeof(&(t.j = 10)).stringof);
  29.  
  30. }
Success #stdin #stdout 0s 2684KB
stdin
Standard input is empty
stdout
int delegate() @property ref
int*
int*
int*