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

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 9 02:04:36 PDT 2014


On Thu, 09 Oct 2014 10:50:44 +0200
Martin Nowak via Digitalmars-d <digitalmars-d at puremagic.com> 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;
> 
> 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();`
> 
> Would this affect your code?
> Do you think it makes your code better or worse?
> Is this just a pointless style change?
> Anything else?
> 
> https://github.com/D-Programming-Language/dmd/pull/4043
i'm all for this. prefix function attributes are *VERY* confusing. i
think this patch should be accepted as soon as possible. i'm already
enjoying it. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141009/dcf3d9ff/attachment.sig>


More information about the Digitalmars-d mailing list