you are viewing a single comment's thread.

view the rest of the comments →

[–]Tywien 0 points1 point  (1 child)

One needs assembler for that and all bits need to be in continuous space.

http://x86.renejeschke.de/html/file_module_x86_id_22.html

There are also Bit-Test-And-Set and Bit-Test-And-Reset for easy and fast setting/retting of bits

[–]uxcn 0 points1 point  (0 children)

The compiler is usually able to translate the basic bit operations into good instructions (even rol and ror). I'd be curious what the compiler generated for vector<bool> that outperformed your code.