All function attributes possible with "@"?
Yuxuan Shui via Digitalmars-d
digitalmars-d at puremagic.com
Wed Dec 14 13:50:54 PST 2016
On Wednesday, 14 December 2016 at 03:49:23 UTC, Jonathan M Davis
wrote:
> On Tuesday, 13 December 2016 at 22:40:47 UTC, 01010100b wrote:
>> So why not let all function attributes which are keywords also
>> be allowed to be used with a "@" prefixed?
> Also, would you even allow @ on stuff like static or const?
Actually, allowing @ will reduce some confusion here.
@const T memberFunc(); // This function takes const(this),
returns int
const T memberFunc(); // This function returns const(int)
Whereas now the second one is actually taking const(this) and
returning int, which is quite surprising to new users coming from
C/C++.
>
> - Jonathan M Davis
More information about the Digitalmars-d
mailing list