I\'m working with a user-defined quantity of bits (I\'m holding a three-dimensional array of bits, so the size increases cubically - assume no less then 512 bits), and need
There is boost.dynamic_bitset which is nearly identical to std::bitset, except that its size is given at runtime. If you're not interested in boost dependency, its source code (which is entirely contained in its header file) could at least give more ideas on how such container could be written.