= Copyable stack delegates (with writefln) = ''Part of'' DelegateCategory == Description == Some examples of how to copy a stack's local variables. Useful if you don't want to modify the original local variables, or if you want to return a stack delegates. == Example == {{{ #!d /* This shows two different ways of creating a pseudo-copied stack delegate. * * The struct method is more efficient. However, it is a bit harder to write & understand. * Also, it requires that you build a delegate by hand using a union, and that may not be * portable across all platforms or compilers. * * The class method is easier to understand and should be totally portable. However, * it is less efficient because of the overhead inherent in a class. */ import std.stdio; int RunDelegate(int delegate() d, int count) { assert(count > 0); int ret; for(int i=0; i