Are there interfaces associated with overloadable operators? E.g. a
Plus
for the
plus()
method. It would be great to be able to define
sum()
on an
Iterable<Plus>
, for instance.
a
Andreas Sinz
07/10/2018, 10:37 PM
no
n
nwh
07/10/2018, 10:37 PM
There is no such thing, as far as I know. Of course, you could make it yourself and define an extension method for
Iterable<Plus>
, but it wouldn't support types you don't create yourself. There is a proposal right now to add the ability to extend existing classes, which would allow what you're looking for