Proposal: static template(fail)

Janice Caron caron800 at googlemail.com
Thu Dec 13 13:52:20 PST 2007


On 12/13/07, Jason House <jason.james.house at gmail.com> wrote:
> If more than one matches successfully, the code wasn't coded well enough.

But then you'd have to do

    template A(T:int) {/*code*/}
    template A(T:anything except an int){/*code*/}

Even apart from the fact that there's no way to express that, it seems
silly. It's perfectly reasonable to allow multiple matches. The
compiler simply tries the most specialised first.



More information about the Digitalmars-d mailing list