First Draft: Member of Operator

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Fri Sep 13 17:45:21 UTC 2024


On 14/09/2024 5:09 AM, Salih Dincer wrote:
> On Friday, 13 September 2024 at 08:41:11 UTC, Richard (Rikki) Andrew 
> Cattermole wrote:
>>
>> Its implemented using two tokens ``:`` and ``Identifier``. So knee 
>> jerk reaction is no, even if it was supported for templates.
> 
> I didn't know that they were implemented using ```:``` and 
> ```Identifier```.
> 
> So what is meant by tokens are that one is the Operator (i.e. the colon 
> symbol) and the Identifier (the name of the enum), and the presence or 
> absence of a space between them will not affect anything, right?

Ah no, together the two tokens form the operator.

What makes it an operator is that it rewrites into 
``context.Identifier`` from ``:Identifier`` using a context.

> In fact, this DIP means this: Previously, the r-value ​​was inferred 
> with ```auto```, now they will be inferred with a operator that is 
> already known on the left side.
> 
> SDB at 79

Storage classes like ``auto`` are left alone, they are unchanged and do 
not support the member of operator.

This is purely additive.


More information about the dip.development mailing list