Template functions, can we make it more simple?
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Fri Aug 2 14:49:19 PDT 2013
On 2013-08-02 21:30:20 +0000, Dicebot said:
> On Friday, 2 August 2013 at 21:20:55 UTC, SteveGuo wrote:
>> We know that normal function parameter declaration is the form of
>> "PARAMTYPE param"
>
> Wrong. Specifying only types was perfectly legal in C and remains so in
> D. It would have been a major breaking change.
One variant discussed was:
auto fun(auto x, auto y) { … }
We concluded that's poor style anyway because most function should have
constraints on types. Truth be told, at the time of that decision
parameter names (viz. x and y) could not be used in template
constraints. Now they could, so in a way that reopens the question.
Either way, this is not enabling something we couldn't do, so it's not
high on the priority list.
Andrei
More information about the Digitalmars-d
mailing list