Should I stop being interested in D language if I don't like to see template instantiation in my code?
Simen Kjærås
simen.kjaras at gmail.com
Thu Nov 14 09:45:55 UTC 2019
On Thursday, 14 November 2019 at 09:30:23 UTC, user9876 wrote:
> A good thing is that in many cases the template instance
> parameters can be deduced from the arguments used:
>
> ---
> import std;
>
> void main()
> {
> assert(max(0,1) == 1);
> // same as assert(max!(int,int)(0,1) == 1);
> }
> ---
>
> This feature is known as "IFTI" see §6,
> https://dlang.org/spec/template.html#function-templates.
>
> You're not forced to use the D templates but you'll have to
> write many code by yourself because the standard library use
> them everywhere.
IFTI is nifty. (sorry, I had to)
--
Simen
More information about the Digitalmars-d-learn
mailing list