Hey btw, do you think we could use this in Phobos?

template BaseElementType(R)
{
    static if (isArray!(ElementType!R))
        alias BaseElementType!(ElementType!R) BaseElementType;
    else static if (is(typeof({return R.init.front();}()) T))
        alias T BaseElementType;
    else
        alias void BaseElementType;
}

assert(is(BaseElementType!(int[][]) == int));

Maybe a better name is RootElementType. Not too sure.

Reply via email to