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

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 9 17:47:59 PDT 2014


On Thursday, 9 October 2014 at 22:29:32 UTC, Joseph Rushton
Wakeling via Digitalmars-d wrote:
> On 09/10/14 13:38, monarch_dodra via Digitalmars-d wrote:
>> I'm not really sure about the: "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();`"
>>
>> I don't think it buys us anything, except maybe silently 
>> changing semantics of
>> code that hibernated through the deprecation process.
>
> Besides,
>
>     const int foo() const
>     {
>         ...
>     }
>
> is fairly ambiguous syntax to my eyes.
>
>     const(int) foo() const
>     {
>         ...
>     }
>
> is less so.

Also

const int delegate() const dg;

Is dg const or the return type ?


More information about the Digitalmars-d mailing list