SFINAE

Jarrett Billingsley jarrett.billingsley at gmail.com
Sun Oct 5 17:30:24 PDT 2008


On Sun, Oct 5, 2008 at 8:21 PM, bearophile <bearophileHUGS at lycos.com> wrote:
> Andrei Alexandrescu:
>> void fun(int a, char[] b);
>> should be treated as if it were declared:
>> void fun(T, U)(T a, U b) if (is(T == int) && is(U == char[]));
>>
>> In other words: a regular function is nothing but an "infinitely
>> specialized" template function.
>
> So you can also take a delegate/function pointer of that fun() template.

There's nothing stopping you from taking the address of templated
functions now, as long as they're fully specified.  Unless you're only
talking about the syntactic benefits of being able to write &fun
instead of &fun!(int, char[]).



More information about the Digitalmars-d mailing list