views:

51

answers:

2

Hallo all, I'm looking for some good library, that works with bitsets or bitarrays. Anybody knows something better (or not worse in all cases) then boost::dynamic_bitset? No matter if the library is open source or commercial.

In my project it is a common task to store and work with large bit masks, that contain less number of ones. So they could be compressed well in memory.

A: 

How about MiniSAT libraries?

http://minisat.se/

I recall this having a simple implementation for bit arrays.

Schedler
A: 

If all you are looking for is space optimization, then std::vector provides a vector specialization that's optimized for space.

http://www.cplusplus.com/reference/stl/vector/

and C++ standard 23.2.5

No idea if this is better than boost:dynamic_bitset, but it's worth investigating if you haven't already looked into it.

Vatsan