TG908
(Tim Gymnich)
1
I was wondering why there are no shorthand operators (like: +=, -=, ...) implemented for measurement. They should be relatively easy to implement.
What kind of operator are you referring to?
1 Like
TG908
(Tim Gymnich)
3
Operators like these: += / -= / ...
Are you referring to this Class?
1 Like
When we originally proposed the feature, the compiler team was worried about adding hundreds of operator overloads for compile performance reasons. Each one adds a new possible resolution, and my understanding is that the algorithm for finding the right one does not scale linearly.
1 Like
While typechecker performance is a very valid concern, I suspect the main issues found in practice are with + more than += so holding off on those in particular probably isn’t critical (@xedin?) . And given these are resilient non-trivial types, possibly more important as performance tweaks than as just shorthand.
xedin
(Pavel Yaskevich)
8
+= is definitely less problematic based on the limited chaining ability, which is the biggest problem associated with +, so it's safer to overload comparing to other operators but if right-hand side is complex it could still create problems.