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);
}

Reply via email to