ArrayArray

Take an array of functions and return a function from and to array.

Constructors

this
this(Function!(A, B)[] fs)
Undocumented in source.

Members

Functions

opCall
B[] opCall(A[] xs)
Undocumented in source.

Properties

length
size_t length [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

fs
Function!(A, B)[] fs;
Undocumented in source.

Examples

static class Adder : Function!(int, int)
{
	int added;
	this (int added)
	{
		this.added = added;
	}
	override int opCall(int x)
	{
		return x + added;
	}
}
import std.range : iota;
import std.array : array;
Function!(int, int)[] adders;
foreach_reverse (i; 0..5)
	adders ~= new Adder(i + 1);
assert (adders.arrayArray()(5.iota.array) == [5, 5, 5, 5, 5]);

Meta