Proposal: static template(fail)

BCS ao at pathlink.com
Fri Dec 14 11:38:33 PST 2007


Reply to Bill,

> Ok so I tried it myself.  Apparently neither D nor C++ works the way I
> thought it did w.r.t SFINAE.  It seems that SFINAE only applies to
> things in the function's declaration, not its contents.  I suppose
> that does make sense, because otherwise it would be damned hard
> to figure out
> when you have a syntax error in specialized templates.

The body of a template must be syntactically correct no matter what. If template(fail) 
gets in I would want semantic errors during specialization to be errors. 
I would expect the programer to catch and bail when unusable arguments are 
given.





More information about the Digitalmars-d mailing list