D1 operator overloads have been deprecated.

uranuz neuranuz at gmail.com
Thu Jul 11 17:58:50 UTC 2019


In change log of nightly builds I see that:
`D1 operator overloads have been deprecated`
The major concern about it is that D2 style operators are 
template functions. And template functions cannot be virtual. 
Does it mean that we shall not be able to decalare operators in 
classes and interfaces that could be overloaded in terms of OOP. 
What is the proposed solution to this problemme?

Currently the only way I see is to declare `final` 
opOpAssign(RHS, string op)(RHS rhs) (for instance). And then 
dispatch them to `regular` virtual functions. But it shall look 
the same as these operator that we are trying to deprecate, but 
with extra `wrapper`. What is the profit of deprecating these D1?

Or is it meant that virtual operators in generally a bad 
practice?! But I don't understand - why?



More information about the Digitalmars-d mailing list