Skip to content
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

Restrict comparisons (< and >) to integer types #830

Closed
guipublic opened this issue Feb 13, 2023 · 0 comments
Closed

Restrict comparisons (< and >) to integer types #830

guipublic opened this issue Feb 13, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@guipublic
Copy link
Contributor

Problem

Comparisons are enabled for TypeVariable so that we use these operators for instance to sort generic arrays, avoiding to re-implement the sort for many types.
The problem is that TypeVariable encompass types that cannot be compared, such as Field or structs.

Solution

Expose a numeric type so that users can write generic functions which will work with any numeric type.

Additional context

cf. discussion about sort function in std::lib in PR #754.

@guipublic guipublic added the enhancement New feature or request label Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants