import std.stdio; void call(int function() func, int count) { for(int i = 0 ; i < count ; i++) { writeln(func()); }} int main() { int i = 0; int counter() { return i += 10; } call(counter, 10); return 0;}
Standard input is empty
prog.d(14): Error: function prog.call (int function() func, int count) is not callable using argument types (int,int) prog.d(14): Error: cannot implicitly convert expression (counter()) of type int to int function()
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!