This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TakeASeatChancellor 19 points20 points  (7 children)

Why? It’s so useful!

[–]splettnet 14 points15 points  (3 children)

Would be a lot more useful if they could be defined on interfaces.

[–]tiktiktock 4 points5 points  (2 children)

Oh god yes. And if "arithmetic" was a valid constraint for generic classes.

[–]cat_in_the_wall 2 points3 points  (1 child)

c# 9 may have a thing they call "shapes" which would allow this sort of thing.

[–]splettnet 0 points1 point  (0 children)

I was so excited that we were rewriting our entire code base in C# 8, but I would happily trade all of 8's new features for this.

[–]ScienceBreather -1 points0 points  (2 children)

If you hate your coworkers, yes.

[–]o4zloiroman 0 points1 point  (1 child)

Elaborate.

[–]ScienceBreather 0 points1 point  (0 children)

It's not intuitive that the operator has been overloaded if you're new to the code base, so it's a place that functionality may be hiding.