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 ?

Reply via email to