apply

Create Range of Elements Generated by fun.

Use for example to generate random instances of return value of fun.

TODO: I believe we need arityMin, arityMax trait here

apply
(
alias fun
N
)
(
N n
)
if (
arityMin0!fun &&
!is(ReturnType!fun == void)
&&
isIntegral!N
)

Examples

import std.datetime: Clock;
import std.array: array;
immutable n = 3;
auto times = n.apply!(Clock.currTime).array;
version (show) dbg(times);
auto spans = times.forwardDifference;
version (show) dbg(spans);

Meta