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

Generic requires signed #1

Open
Rudxain opened this issue Apr 12, 2024 · 1 comment
Open

Generic requires signed #1

Rudxain opened this issue Apr 12, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Rudxain
Copy link
Owner

Rudxain commented Apr 12, 2024

The current impl of the generic fn requires all args to be signed types (impl Neg). This isn't ergonomic at all.

However, I have no idea how to define a trait-bound that forbids a specific trait. In this case, the new fn must forbid any type that impls the Neg trait, to guarantee it'll be unsigned, and therefore no need for abs

@Rudxain Rudxain added enhancement New feature or request help wanted Extra attention is needed labels Apr 12, 2024
@Rudxain
Copy link
Owner Author

Rudxain commented Apr 12, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant