Generic method parameter, resticted to numeric types with << support

In your initial post you said that bitvec was slow. Did you use a benchmarking crate like criterion? And did you run with --release? If you didn't do these things, your performance test may have been invalid. It was definitely invalid if you didn't use --release. What type of test did you do?

Oh, now I see from the other topic that you used debug mode for performance testing, which is not meaningful.

Disregarding performance testing, bitvec does not have a 64 bit limit so it has to index into an array before it does the bit shift and get/set operation. That's what makes the implementation discussed here seem more appropriate for your use case.

But speaking of that:

[quote="StefanSalewski, post:1, topic:107448"]
So I decided to try for learning purposes to implement a custom 64-bit set type.

Does this mean you actually don't need more than 64 bits? I assumed that you did not when reading your post. But now I wonder if that's true.

Edit: I see in the other topic that you do only need 64 bits.