On Friday, 6 May 2016 at 06:08:24 UTC, Dicebot wrote:
Unless parameter list is very (very!) long, I'd suggest to
simply copy it into a stack struct. Something like this:
auto toInputRange (T...) (T args)
{
struct Range
{
T args;
size_t index;
T[0] front () { return args[index]; }
void popFront () { ++index; }
bool empty () { return index >= args.length; }
}
return Range(args, 0);
}
(note that you can actually make it random access range and not
just input range, I simply have not defined required methods)