Fabian Claßen admin at
Tue Dec 2 10:30:47 PST 2008

I have a problem:

What's wrong about this code?

import std.stdio;

int main() {
	writefln("%f", add(100, 786, 56.0));
	return 0;

double add(double delegate()[] dgs...) {
	double result = 0;
	foreach(double delegate() dg; dgs) {
		result += dg;
	return result;

Or a better question is: How can I get the value out of the delegate?

Greetings Fabian Claßen

PS: I am a beginner :P
-------------- next part --------------
A non-text attachment was scrubbed...
Name: admin.vcf
Type: text/x-vcard
Size: 190 bytes
Desc: not available
URL: <>

More information about the Digitalmars-d mailing list