Without D1-style operator overloads, the `in` operator for classes doesn't make sense

Ontonator publicnator at gmail.com
Mon Jan 6 11:16:49 UTC 2020


On Monday, 6 January 2020 at 10:55:15 UTC, Don wrote:
> In DMD 2.088.0, the D1 operator overloads were deprecated, in 
> favour of the D2 syntax which has been available for years.
>
> [...]

I’m on my phone right now, so I can’t check, but could you 
emulate a virtual operator by creating a virtual method (e.g. 
`contains`) which is called from the operator and which child 
classes could override? It isn’t as ergonomic, but it should work.


More information about the Digitalmars-d mailing list