Template functions, can we make it more simple?

monarch_dodra monarchdodra at gmail.com
Sat Aug 3 03:29:38 PDT 2013


On Saturday, 3 August 2013 at 08:59:41 UTC, F i L wrote:
> monarch_dodra wrote:
>> Regardless of the existing merits, that would be a (massive) 
>> breaking change, and as mentioned, it brings nothing we 
>> couldn't do before...
>
> Sure, but not if you do it like my second example:
>
>    auto func(auto a, auto b) // like C++14
>
> That doesn't break anything, right?

I'm not sure auto is the best choice of keywords, given potential 
clashes with auto ref:

What if you want to pass a by ref?
auto func(auto ref a, auto ref b) ?
auto func(ref auto a, ref auto b) ?

What if you want to pass them by *auto* ref?
auto func(auto auto ref a, auto auto ref b) ?
auto func(auto ref auto a, auto ref auto b) ?

At this point, I'd really prefer just seeing classic template 
syntax...


More information about the Digitalmars-d mailing list