-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic operators support in C#. #7599
Comments
I would love this feature. Non-generic operators are limiting. |
Yes. In my opinion this is now absolutely necessary. Having only generics that are not fully equivalent to C++ generics (in functional behaviour) are absolutely mandatory. I guess there are many guys out there requesting this feature. Instead a lot of people here are complaining about syntactic sugar. |
Might help solve the problem of verbose generic patterns discussed in #10153. If |
I have needed this feature trying to model mathematical entities and it is a definite must. It will save tons of repetitive code and make the conceptual model richer. Also type inference would do wonders in this scenario. |
Issue moved to dotnet/csharplang #813 via ZenHub |
Currently c# does not support generic operators definition like that:
This support can be usefull to build advanced libs with expressions (validation expressions in my case).
This is only C# limitation, CLR ready for this feature.
We can already define operator in different syntax.
No changes in CLR needed to define generic operator in this syntax:
but later C# does not recognize it.
Please add this proposal to the C# 7.0 wish list.
The text was updated successfully, but these errors were encountered: