Tutorial by Examples

Scope guards allow executing statements at certain conditions if the current block is left. import core.stdc.stdlib; void main() { int* p = cast(int*)malloc(int.sizeof); scope(exit) free(p); }
import std.stdio; void main() { writeln("<html>"); scope(exit) writeln("</html>"); { writeln("\t<head>"); scope(exit) writeln("\t</head>"); "\t\t<title>%s</title>".write...

Page 1 of 1