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

ConvApprox/CastApprox; tuple + array support; doc #21

Merged
merged 17 commits into from
Feb 15, 2022
Merged

ConvApprox/CastApprox; tuple + array support; doc #21

merged 17 commits into from
Feb 15, 2022

Conversation

dhardy
Copy link
Contributor

@dhardy dhardy commented Feb 15, 2022

This will likely be released as 0.5:

  • conv methods now have default implementations over try_conv methods to ease third-party implementations
  • Add ConvApprox and CastApprox for approximate conversions without specific rounding; implement for f64 -> f32
  • ConvApprox<T> is auto-implemented over Conv<T>
  • Support arrays and tuples for Conv and ConvFloat (and therefore Cast and CastFloat); closes Extend to other types: NonZero*, tuples, arrays, ...? #19
  • Update documentation
  • MSRV is now 1.53.0

Limitations due to lack of specialization (or other conflicting-trait-impl resolution):

  • impl<T> Conv<T> for T was removed
  • we cannot implement array/tuple support for ConvApprox
  • we cannot auto-implement ConvApprox<T> over ConvFloat<T>

Limitation due to unsized-type support:

  • array implementations require T: Copy + Default and may not be optimal

Limitations due to code size:

  • Conv supports 0-6 element tuples
  • ConvFloat only supports 2-tuples

@dhardy dhardy merged commit f08180a into master Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend to other types: NonZero*, tuples, arrays, ...?
1 participant