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

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 9 03:18:58 PDT 2014


Martin Nowak:

> 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;

+1 from me.


> Then at some future point we could apply the left hand side 
> qualifiers to the return type, e.g. `const int foo();` == 
> `const(int) foo();`

In this case I think it's better to focus on the most important 
thing first.

Bye,
bearophile


More information about the Digitalmars-d mailing list