Is the use of std::vector objects in C++ acceptable, or should I use an alternative?

后端 未结 7 1007
有刺的猬
有刺的猬 2020-11-29 09:29

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

7条回答
  •  被撕碎了的回忆
    2020-11-29 09:36

    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.

提交回复
热议问题