Derives for `Eq` and `Hash`
CryZe opened this issue · 2 comments
CryZe commented
It probably makes sense to provide derives for Eq
(and PartialEq
) and Hash
in bytemuck. On a Pod
type Eq
can be a simple memcmp / bcmp. Hashing is also much more efficient as you can provide all bytes at once.
Lokathor commented
Hm. I'm not against this, but I'll also note that f32
is pod, but a memcmp wouldn't be accurate for 0.0 and -0.0 (which are supposed to be equal).
CryZe commented
Yeah, maybe the derives could be named ByteEq, ByteHash or so to clarify that?