Perhaps you want an array of bitset:
#include <bitset>
int main() {
std::bitset<8> bytes[512];
}
It is an array of bitsets of 8 bytes.
A std::bitset
is a fixed size array of bools (0 and 1 for true and false), so since a byte is 8 bits, we need a std::bitset
of 8 bytes, and we declare this like this:
std::bitset<8>
Then, since we want 512 bytes, we make an array of bitsets, like so:
std::bitset<8> bytes[512];
Then, you can have std::vector
s of these or something.
You could also have a bitset of 4096 bits (512 bytes where each is 8 bits), like so:
std::bitset<4096> bytes;
You could then have a dynamic container containing there, like a std::vector
.
As for Boost Pool, there is a great tutorial here: https://theboostcpplibraries.com/boost.pool.