Proposal: static template(fail)

Janice Caron caron800 at googlemail.com
Fri Dec 14 12:59:16 PST 2007


On 12/14/07, BCS <ao at pathlink.com> wrote:
> That only works if the maintainers of the two templates work together. Here
> is an example where they wouldn't be:

Gotcha. Well, it seems doable, so long as there is zero chance of
order-dependency creeping it. That would be my only worry.

If order dependency does turn out to be an issue, then it might be
wise to consider the alternative (and I believe, equivalent)
suggestion:

    template A(T:if(someTest!(T)))
    {
        /*code*/
    }

which would eliminate the need for that sort of overloading, but still
give just as much power to template programming.



More information about the Digitalmars-d mailing list