top | item 44501886

(no title)

jb55 | 7 months ago

I will remove the novel wording just for the hacker news geniuses. I have been programming for 26 years and have never encountered this pattern, nor could I find it in any libraries, which is why I decided to wrap it up in a library.

If a simple bitset like this exists in a library somewhere I would love to see where! Most implementations I've seen over-complicate it for simple use cases like this.

discuss

order

sumtechguy|7 months ago

You may enjoy this page then. https://graphics.stanford.edu/~seander/bithacks.html

Bunches of bit twiddling things people like to do in different places for either speed/space.

jb55|7 months ago

I have had the experience of explaining to coworkers how bitwise operators even work more than once. I think sometimes people overestimate the average programmers knowledge when it comes to bit operations. modern programming is so detached from having to use that for day to day work.

I am aware of the bithacks page, but I just found encoding the bit coordinate in the ID itself so clever.

dooglius|7 months ago

C++ std::vector<bool>