Menu
Home
Create new Paste
Log in
Code
Theme: cobalt
Theme: eclipse
Theme: elegant
Theme: monokai
Theme: neat
Theme: night
Theme: rubyblue
import std.stdio; class A { int x = 1; struct S { A a; alias a this; int y = 2; void foo() { writeln(this.x + this.y); } } S s; alias s this; this() { this.s.a = this; } } void main() { A a = new A; a.foo(); A.S s; //s.foo(); //Segmentation fault }
Result:
Success
/
Return code: 0
/
Compilation time:
0.515
seconds
/
Run time:
0.001
seconds
Disassembly
Application output:
3
Username
Message
Add comment
Paste info
Author:
Guest
Views:
102
Private:
no
Expires:
Never
Uploaded:
09.12.12 10:05
Votes
:
0
Tweet
Compilation
Compiler:
DMD 2.x Gi
Pointer size:
m64
Actions
Download
Fork
Raw
×
Confirm
Are you sure you want to delete this paste?
There's no way back!
×
Confirm
Reason