fork download
  1. import std.stdio;
  2.  
  3. struct LocationPrinter
  4. {
  5. public void printLocation() const
  6. {
  7. writeln("I am at ", &this, "." );
  8. }
  9. }
  10.  
  11. void takeLocation(in LocationPrinter location)
  12. {
  13. location.printLocation();
  14. }
  15.  
  16. void main()
  17. {
  18. LocationPrinter location;
  19. location.printLocation();
  20. takeLocation(location);
  21. }
Success #stdin #stdout 0.01s 2120KB
stdin
Standard input is empty
stdout
I am at BFD20384.
I am at BFD20374.