-
Notifications
You must be signed in to change notification settings - Fork 6
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
Implement FloatEq over standard types #3
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FloatEq is currently implemented over the following types:
f32
f64
[T; n] where T: FloatEq
num::Complex<T> where T: FloatEq
(behind a feature flag)It would be helpful to expand this to be implemented over a similar range of standard container types as
PartialEq
is, This is a list of the potentially relevant impls, using the PartialEq Implementors list as of version 1.43.1:Special
Reference types (immutable)
TODO: The corresponsing
a == &b
and&a == b
are missing from PartialEq because of this issue, but do we have the same restraint? EDIT: yes.Reference types (mutable)
Slices
Arrays
Tuples
Implementation across tuples is dependent on thinking more generally about how epsilon values should apply to heterogeneous types, and whether they ought to be supported at all.
Vec
TODO: Is
impl<'_, const N: usize, A, B> PartialEq<&'_ mut [B; N]> for Vec<A>
missing?VecDeque
Set collections
TODO: I assume that HashSet is a bad target since it requires Eq, whereas BTrees might be more amenable.
Map collections
TODO: I assume these should these be FloatEq over just their values, since they require Eq on keys.
Result
TODO: Should this just be over
T: FloatEq
, or should E also be involved?Cow
Simple inner type
The text was updated successfully, but these errors were encountered: