-
Is there a reason SearchValues cant be overridden? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
It uses highly specialized algorithms based on the exact input values. The public |
Beta Was this translation helpful? Give feedback.
-
Yes, providing different implementations is intentionally restricted to .NET (CoreLib) itself. If someone has better ideas around how something can be implemented, or more patterns we should consider special-casing, we're happy to consider including them into .NET itself. In such cases the user also shouldn't be blocked by the lack of extensibility as a more specialized |
Beta Was this translation helpful? Give feedback.
Yes, providing different implementations is intentionally restricted to .NET (CoreLib) itself.
This allows us to evolve the type easier without having to think about whether adding new APIs will break something for custom implementations.
If someone has better ideas around how something can be implemented, or more patterns we should consider special-casing, we're happy to consider including them into .NET itself.
Did you have anything like that in mind / why did you wish to override it?
In such cases the user also shouldn't be blocked by the lack of extensibility as a more specialized
IndexOfAny
-like implementation can easily live as an extenion method in user code.