What features of D you would not miss?

bauss jacobbauss at gmail.com
Thu Sep 15 14:10:07 UTC 2022


On Thursday, 15 September 2022 at 13:43:01 UTC, Dennis wrote:
> On Thursday, 15 September 2022 at 08:40:22 UTC, Dukc wrote:
>> What features could be removed from D if it were up to you? 
>> Please consider the breakage that would result from the 
>> removal, don't settle on thinking what shouldn't have been 
>> added in the first place.
>
> - `alias this` inside a class
>

I would be all for this if we could get something like 
opImplCast() which would basically be the same as opCast() but 
without requiring cast.

I believe the operator overloads must be static for it to work 
properly with ex. `Foo foo = 100;`.

```
Foo foo = 100; // Would trigger static void opImplCast(T)(T 
value) where T is int.
int a = foo; // Would trigger ex. static T opImplCast(T)(Foo 
instance) where T is int
```

You should of course be able to be explicit about types like `int 
opImplCast(Foo instance);`


More information about the Digitalmars-d mailing list