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

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 9 03:27:11 PDT 2014


Am Thu, 09 Oct 2014 10:50:44 +0200
schrieb Martin Nowak <code at dawg.eu>:


> Would this affect your code?
Most old code, yes. I used to write all attributes on the left hand
side, but switched to right hand side some time ago. 

> Do you think it makes your code better or worse?
Probably better, although I tried to be careful with the left hand side
attributes so it shouldn't change to much.

> Is this just a pointless style change?
> Anything else?
Code will probably look nicer, but I'm not sure if it's consistent.
with const(int) it's obvious that the return value is const. With
const int abcd() @safe
this might be less obvious.

Also fixing old code manually would be very tedious.



More information about the Digitalmars-d mailing list