On Thursday, 20 October 2016 at 12:38:40 UTC, Nordlöw wrote:
ElementType!R[n] arrayN(size_t n, R)(R r)
{
    assert(r.length == n);
    typeof(return) dst;
    import std.algorithm.mutation : copy;
    r.copy(dst[]);
    return dst;
}

Is there a place for part of this logic in Phobos?

I'm thinking perhaps array{N,Exactly} should be added to std.array.

The idea came to me after learning about dependent types in Idris:

http://www.idris-lang.org/

Reply via email to