What should be signature of `foo` in the following piece of code?

    auto foo(range r) {
      // do something with the `r`
    }

    void main() {
      foo([1,2,3].map!(x => x*x));
    }


Right now I use `.array` to convert the range before passing:

    auto foo(int[] r) {
      // do something with the `r`
    }

    void main() {
      foo([1,2,3].map!(x => x*x).array);
    }

But it doesn't feel right.

Thanks,
-- 
Bahman

Reply via email to