1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
import std.stdio; struct S { int go() { U u; u.s = this; return u.a + u.b; } } union U { S* s; struct { short a; short b; } } void main() { U u; u.a= 54; u.b = 42; int delegate() dg = &u.s.go; writef("%s\n", dg()); }
1
96