On Wednesday, 18 August 2021 at 06:53:51 UTC, Tejas wrote:

void funcTemplate(T:int)(T a){
     writeln("argument is int");
}

void funcTemplate(T : long)(T a){
     writeln("argument is long integer");
}

void main(){
     int a;
     long b;
     func(a);
     func(b);

     funcTemplate(a);
     funcTemplate(b);

}

```


Domninikus, Tejas, and All,

I see that I had been (stupidly) omitting the exclamation point
after **"isIntegral"** in my clumsy attempts to use the traits ...
thanks for your clear example helping me identify my error.

Also, thanks for mentioning the words **"template specialization"** , I did
not know what to call the use of **":"** in templates.

Now, I have a search term I can use to learn more ...and find it is in Phillippe
Signaud's informative "D-templates-tutorial".

Thanks again,
James

PS Also, I am enjoying, a entertaining and educational tutorial that Phillippe
has linked in his tutorial.  Other may learn from this as well:

http://www.semitwist.com/articles/EfficientAndFlexible/SinglePage/


Reply via email to