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