When I want an array of flags it has typically pained me to use an entire byte (or word) to store each one, as would be the result if I made an array of bool
s or some other numeric type that could be set to 0 or 1. But now I wonder whether using a structure that is more space-efficient is worth it given the (albeit hopefully very slight) additional overhead of shifting and bit testing.
In my company we use Rogue Wave tools (though hopefully not for much longer) and it's their RWBitVec
that I've used for this purpose up until now.