Menu
Home
Create new Paste
Log in
Code
Theme: cobalt
Theme: eclipse
Theme: elegant
Theme: monokai
Theme: neat
Theme: night
Theme: rubyblue
module test2; import std.stdio; namespace io { void print(T...)(T args) { writeln(args); } } //use io; use io : print; //use io : output = print; class Bar { } class Foo : Bar { public: void print() { writeln("Hello there, i'm class Foo."); } @property Bar getBar() const { return new Bar(); } } class Quatz { public: this() { writeln("Bar CTor"); } @property static Foo getFoo() { return new Foo(); } ~this() { writeln("Bar DTor"); } } void test(int& i1, int &i2) { } void test2(Bar& b) { writeln("join function test2"); local Quatz bl = new Quatz(); writeln("left function test2"); } class A { public: B my_b; } class B { public: void print() const { } Foo getFoo() const { return new Foo(); } } void main() { writeln("main start"); Foo f = new Foo(); Foo& fr = f; uint id = 42; uint &ref_id = id; //Bar &b = f; Foo f2; f?.print(); int b = 2; int a = b & 4; Bar b2_ = new Bar(); //Bar &b2 = b2_; test2(@b2_); A my_a; my_a?.my_b.print(); my_a?.my_b?.print(); //my_a.my_b?.print(); B main_b1 = my_a.my_b; main_b1?.print(); Foo main_b2_f = my_a?.my_b?.getFoo(); writeln("main end"); }
Username
Message
Add comment
Paste info
Author:
Namespace
Views:
426
Private:
yes
Expires:
Never
Uploaded:
06.10.12 20:53
Votes
:
0
Tweet
Actions
Download
Fork
Raw
×
Confirm
Are you sure you want to delete this paste?
There's no way back!
×
Confirm
Reason