On Monday, 1 June 2015 at 11:20:52 UTC, Per Nordlöw wrote:
template Chainable() {
       Chain!(typeof(this), Range) opCat(Range)(Range r) {
           return chain(this, r);
       }
}

Would it suffice to restrict `opCat` as

    Chain!(typeof(this), Range) opCat(Range)(Range r)
if (isInputRange!Range && is(CommonElementType!(typeof(this), Range)))

?

given that

template CommonElementType(Rs...)
{
alias CommonElementType = CommonType!(staticMap!(ElementType, Rs));
}

In general, should we let `Chain` do the error checking or should we copy its retrictions into `opCat`s restrictions?

Reply via email to