Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module test;
- import tango.io.Stdout;
- struct Point
- {
- int x;
- int y;
- }
- class Foo
- {
- private Point point_;
- Point point (Point point)
- {
- return point_ = point;
- }
- Point point ()
- {
- return point_;
- }
- }
- class Bar
- {
- Point point;
- }
- void main ()
- {
- auto foo = new Foo;
- foo.point.x = 3;
- auto bar = new Bar;
- bar.point.x = 3;
- Stdout.formatln("foo.point.x={}, bar.point.x={}", foo.point.x, bar.point.x); // prints foo.point.x=0, bar.point.x=3
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement