-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[ER] NonZero const generic constructor #73121
Copy link
Copy link
Open
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.S-waiting-on-ACPStatus: PR has an ACP and is waiting for the ACP to complete.Status: PR has an ACP and is waiting for the ACP to complete.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.S-waiting-on-ACPStatus: PR has an ACP and is waiting for the ACP to complete.Status: PR has an ACP and is waiting for the ACP to complete.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
It could be nice to have std::iter::Step for the NonZeroX numbers, so in this code instead of having about 1000 unwrap:
You only need two:
If also a const-generics-based constructor is added to stdlib then the number of run-time unwraps goes to zero (the two panics become compile-time):
A further improvement should come from const generics of arbitrary type (currently not allowed):