Template functions, can we make it more simple?

QAston qaston at gmail.com
Fri Aug 2 14:50:08 PDT 2013


On Friday, 2 August 2013 at 21:29:12 UTC, SteveGuo wrote:
>>
>> Question is "should we"? It creates syntax ambiguity (a and b 
>> can be already existing types) and does not really improve 
>> language.
>
> Sorry for my pool English:p
>
> I think compiler can detect the difference.
> auto Add(a, b) {} // Compiler can detect "there is nothing in 
> front of a and b, so a and b is template, not types defined in 
> other modules"

auto Add(auto a, auto b) would be unambigious imo.

I don't see a need for that language change though.

My favourite colour of a bikeshed is blue.


More information about the Digitalmars-d mailing list