copy must be const?!?

Andy Valencia dont at spam.me
Fri Jul 26 02:34:12 UTC 2024


On Thursday, 25 July 2024 at 13:07:03 UTC, Jonathan M Davis wrote:

> It's most definitely not a bug that IFTI (Implicit Function 
> Template Instantiation) instantiates the template with the 
> exact type that it's given.

The "principle of least astonishment" certainly supports this 
behavior.  To check my understanding, I forced the type of 
instantiation:

   writeln(test2!int(v));

and that worked as I expected.

Andy



More information about the Digitalmars-d-learn mailing list