constraints,template specialization,drop IFTI

BLS windevguy at hotmail.de
Wed Jul 15 09:30:49 PDT 2009


I have somehow the idea that D constraints and template specialization 
should merge.
Guess what I want to say is that instead of accepting the  compiler 
decision for template specialization  a constraints could be used for : 
"I am not the one who is able to fulfill your needs.. try this template 
instead."

template Foo(int N)
         if ( ( N & 1 _else_ FooOdd!(int N)) )
{
     ...
}

Already something. To quote Christian Kamm :
  --
/I also feel that specialization may just be a special case of constraints -
with the added benefit that implicit function template instantiation works./

A smarter implementation will probably support tuple based pattern matching.

In case that D will have such a feature ...we have to find a new snappy 
word for _fuzzy secure meta-programming_ .

What do you think ?




More information about the Digitalmars-d mailing list