Overloading funtion templates.

Balagopal Komarath via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 29 22:56:35 PDT 2017


On Friday, 30 June 2017 at 04:51:23 UTC, vit wrote:
> import std.traits : isCallable;
>
> auto foo(alias F, T)(T x)
> if(isCallable!F)			//this line is optional
> {
>     return F(x);
> }
>

Thanks. That works.




More information about the Digitalmars-d-learn mailing list