Robbepop / apint

Arbitrary precision integers library.
Other
27 stars 4 forks source link

Implement Hash for ApInt #14

Closed Robbepop closed 6 years ago

Robbepop commented 6 years ago

Implement std::hash::Hash for ApInt. Since ApInt is similar to a Vec<u64 we can employ a similar strategy to actually implement Hash. Vec did it by deref into a slice over its elements and then simply uses the Hash implementation of the fundamental slice type as can be seen here.

While doing this it might be useful to also implement Hash for other types in the public interface.

Implement std::hash::Hash for ...

Robbepop commented 6 years ago

Implemented in 36070c78e3168ba8f2da55b752de937175b40f6e.