D1 operator overloads have been deprecated.
uranuz
neuranuz at gmail.com
Sun Oct 6 12:28:57 UTC 2019
On Sunday, 6 October 2019 at 10:39:04 UTC, Gregor Mückl wrote:
> On Sunday, 6 October 2019 at 08:34:40 UTC, uranuz wrote:
>> Now user of language must actually have two sets of functions
>> with proposed workaround with classes. The final template
>> function and the old-style D1 (yes we can rename it and so on,
>> but this doesn't change so much). We should have two entities
>> instead of one that we had. So this is very "contradictive"
>> improvement.
>
> You only need this workaround if you habe a class hierarchy
> where overloaded operators are
> overridden in subclasses. This is a very narrow set of cases.
> Otherwise, implementing only the D2 way is sufficient. How
> often do you actually need to override operator behaviour in
> subclasses? I'm genuinely curious about use cases.
Personally, I have several places in my code where I need to add
`in` into basic interface and implement it in derived classes. It
is not some "weird", "narrow" set of cases, I believe.
For instance, I have different implementations of `in` in all of
these classes. The main problemme for me is that you need to
change the basic interface, that is used by all the classes. It
is not very good, especially if anybody still cannot explain what
benefits it gives me. And also you (maybe) need to fix all of the
derived implementations...
Every time I do something I want to know: what for? Especially,
if it touches some basic aspects. But still I haven't got any
answer...
More information about the Digitalmars-d
mailing list