Without D1-style operator overloads, the `in` operator for classes doesn't make sense
Steven Schveighoffer
schveiguy at gmail.com
Mon Jan 6 18:22:53 UTC 2020
On 1/6/20 12:25 PM, Don wrote:
> On Monday, 6 January 2020 at 14:14:35 UTC, Steven Schveighoffer wrote:
>> In fact, you can easily make a mixin template that will implement all
>> the D2 style operators when you have defined the D1 style ones.
>
> That's blocked as a direct migration path, because deprecation warnings
> are generated if you use the D1 names. (And no, you cannot turn off
> deprecation warnings, that turns off *all* deprecation warnings).
>
This is actually a bug IMO. If you define opBinaryRight!"in", then
opIn_r (yes, I got that wrong in the example) should not be used by the
compiler. opIn_r after all is a valid function name, and there's no
reason it needs to be marked as deprecated if not called via the operator.
If not filed, someone should file it. Same goes for all the D1 operators.
-Steve
More information about the Digitalmars-d
mailing list