void main() { C c = new C(); writeln(c.foo(1)); }
interface I { int foo(int i) in { assert(i > 2); } out (result) { assert(result != 0); } void baa(); } class C : I { int foo(int i) { return i * 2; } void baa() { writeln("Hello!"); } }
Dr. Assembly via Digitalmars-d-learn Wed, 15 Nov 2017 06:45:33 -0800
void main() { C c = new C(); writeln(c.foo(1)); }
interface I { int foo(int i) in { assert(i > 2); } out (result) { assert(result != 0); } void baa(); } class C : I { int foo(int i) { return i * 2; } void baa() { writeln("Hello!"); } }