RFC: DIP draft for "Compiler-defined Attribute Consistency"

Ogi ogion.art at gmail.com
Wed Jul 14 16:55:30 UTC 2021


On Wednesday, 14 July 2021 at 16:18:11 UTC, Adam D Ruppe wrote:
> On Wednesday, 14 July 2021 at 15:54:06 UTC, user1234 wrote:
>> I'm worried not to see `@const` and `@inout`.
>
> eh those are type constructors not attributes.

Except when they are attributes — when applied to member 
functions.

It makes no sense that `const int` variable is a constant integer 
while `const int function()` is a constant member function of 
some struct or class that returns non-constant integer. We should 
introduce `@const` (and others) as a proper function attribute 
and deprecate the ambiguous `const int function()` syntax.


More information about the Digitalmars-d mailing list