How can I implement this in D: a variant array of varying function pointer types (diff number of args or types)

Enjoys Math via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 17 02:49:14 PST 2017


Z add(Z...)(Z a...) {
	return a + b;
}

func[] operatorPool = [&add!int];

Variant library isn't liking that.  Removing & causes another 
error.

Essentially I want a pool of all operators that I define, but 
these operators can be of differing types (which I should be able 
to programatically grab), and different N-aryness.




More information about the Digitalmars-d-learn mailing list