Make const, immutable, inout, and shared illegal as function attributes on the left-hand side of a function

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 9 06:37:30 PDT 2014


On Thursday, 9 October 2014 at 08:50:52 UTC, Martin Nowak wrote:
> Kenji just proposed a slightly controversial pull request so I 
> want to reach out for more people to discuss it's tradeoffs.
> It's about deprecating function qualifiers on the left hand 
> side of a function.
>
> So instead of
>     const int foo();
> you'd should write
>     int foo() const;

Finally.

> Would this affect your code?

Yes, eventually, but I am willing to make the change and it is 
trivial compared to some other D2 migration related things :)

> Do you think it makes your code better or worse?
> Is this just a pointless style change?

I believe it is much less error-prone, prefix notation is 
currently a common cause of mis-interpretation from the reader.


More information about the Digitalmars-d mailing list