"SFINAE is Evil"

Georg Wrede georg at nospam.org
Tue Mar 25 13:29:22 PDT 2008


Jason House wrote:
> I also had the feeling of "SFINAE is needed, but I can't come up with any
> examples".  I find it interesting that nobody posted a need for SFINAE. 
> Because of that, and all the pitfalls, I agree that SFINAE as a default
> behavior is undesirable and should disapear from D.
> 
> Rather than propose an alternative to it, I wanted to understand how it
> should be used in D.  With no examples of it, I've started leaning toward
> simple removal of it.  I started this thread thinking the likely outcome
> would be something like your proposal.  Now I'm thinking that SFINAE is not
> needed.  If that's not true, I'm thinking it may be better to enhance is
> clauses and/or CTFE to cover the (small) capability gap.
> 
> What do you think of that?  If you (and others paying attention to this
> thread) agree, how do we get the attention of Walter?  Maybe it should be a
> feature request or an entry on the unofficial D wishlist?

I suspect it would be quite simple to add a compiler switch to turn 
SFINAE on or off?

Since D2 is "experimental" anyway, we might have this switch for a few 
months, and then see if anybody actually used it. The default would be 
SF is an error.



More information about the Digitalmars-d mailing list