Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add CheckedNumOps#314

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
cod10129 wants to merge3 commits intorust-num:master
base:master
Choose a base branch
Loading
fromcod10129:master
Open

Conversation

@cod10129
Copy link

Working with numerics innum-traits is biased towards using the standard traits, which is generally good. However, checked arithmetic is lacking a unifying trait (likeNumOps). This PR adds that.
This traitshould theoretically be a supertrait ofPrimInt. However, this trait (likeNumOps: Rem), requiresCheckedRem.PrimInt does not currently require that, meaning that this would be abreaking change. (PrimInt: CheckedNumOps for a future release?)

@cuviper
Copy link
Member

This traitshould theoretically be a supertrait ofPrimInt. However, this trait (likeNumOps: Rem), requiresCheckedRem.PrimInt does not currently require that, meaning that this would be abreaking change. (PrimInt: CheckedNumOps for a future release?)

I think it's just thatCheckedRem didn't exist at the time. Yes, it would make sense, but also yes, it would be a breaking change.

You did not actually includeCheckedNumOps: CheckedRem though -- did you mean to?

I think this is the right thing to do here, but I'm not entirely sure.
@cod10129
Copy link
Author

I wrote all that out about it and forgot to actually requireCheckedRem. I think my idea was that I'm not sure what should happen with it.CheckedNumOps couldnot requireCheckedRem and be a supertrait ofPrimInt, or itcould requireCheckedRem and be disconnected fromPrimInt. I wasn't sure on the best course of action, so I think that's why I leftCheckedRem out.
However, now I think that usingCheckedRem is the right way to go. If you don't think so you can roll back the most recent commit to the fork, which actually addsCheckedRem.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@cod10129@cuviper

[8]ページ先頭

©2009-2025 Movatter.jp